From fc5f8e888c9ccfda7d739493c439437a917b9902 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 26 Apr 2023 09:34:29 +0300 Subject: Expose 'isAdmin' user property over API --- src/main/java/com/juick/model/Message.java | 2 +- src/main/java/com/juick/model/User.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/juick/model') diff --git a/src/main/java/com/juick/model/Message.java b/src/main/java/com/juick/model/Message.java index 3c86970b..32d888a7 100644 --- a/src/main/java/com/juick/model/Message.java +++ b/src/main/java/com/juick/model/Message.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2023, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/main/java/com/juick/model/User.java b/src/main/java/com/juick/model/User.java index 5f89ecfc..7f04a744 100644 --- a/src/main/java/com/juick/model/User.java +++ b/src/main/java/com/juick/model/User.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2023, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -62,6 +62,8 @@ public class User implements Serializable { private String description; private final List tagStats; private boolean premium; + @XmlTransient + private boolean admin; public User() { tokens = new ArrayList<>(); @@ -288,4 +290,12 @@ public class User implements Serializable { public void setPremium(boolean premium) { this.premium = premium; } + + public boolean isAdmin() { + return admin; + } + + public void setAdmin(boolean admin) { + this.admin = admin; + } } -- cgit v1.2.3