mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
fix service generation
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class UserModel implements Serializable {
|
||||
|
||||
private String name;
|
||||
private Set<String> roles = Sets.newHashSet();
|
||||
private boolean enabled;
|
||||
private boolean admin;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -20,12 +17,12 @@ public class UserModel implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Set<String> getRoles() {
|
||||
return roles;
|
||||
public boolean isAdmin() {
|
||||
return admin;
|
||||
}
|
||||
|
||||
public void setRoles(Set<String> roles) {
|
||||
this.roles = roles;
|
||||
public void setAdmin(boolean admin) {
|
||||
this.admin = admin;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
||||
@@ -31,7 +31,9 @@ public class AdminUsersREST extends AbstractREST {
|
||||
userModel.setEnabled(!user.isDisabled());
|
||||
users.put(key, userModel);
|
||||
}
|
||||
userModel.getRoles().add(role.getRole());
|
||||
if (Role.ADMIN.equals(role.getRole())) {
|
||||
userModel.setAdmin(true);
|
||||
}
|
||||
}
|
||||
return users.values();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user