Skip to content

Commit

Permalink
Merge pull request #979 from okauppinen/user-isAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakarFin authored Jul 27, 2023
2 parents f3513e6 + bb63f6c commit 87a6487
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion service-base/src/main/java/fi/nls/oskari/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class User implements Serializable {
private static final String KEY_USERUUID = "userUUID";
private static final String KEY_USERID = "userID";
private final static String KEY_ROLES = "roles";
private final static String KEY_ADMIN = "admin";

private long id = -1;
private String lastname = "";
Expand Down Expand Up @@ -218,7 +219,9 @@ public JSONObject toJSON() {
userData.put(KEY_NICKNAME, getScreenname());
userData.put(KEY_USERUUID, getUuid());
userData.put(KEY_USERID, getId());

if (isAdmin()){
userData.put(KEY_ADMIN, true);
}
JSONArray roles = new JSONArray();
for (Role role: getRoles()) {
roles.put(role.toJSON());
Expand Down

0 comments on commit 87a6487

Please sign in to comment.