Package jmri
Interface User
-
- All Known Implementing Classes:
DefaultUser
public interface User
An user in the permission system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRole(Role role)
boolean
changePassword(java.lang.String oldPassword, java.lang.String newPassword)
boolean
ensureAtLeastPermission(Permission permission, PermissionValue minValue)
Checks if the current user has the permission.java.lang.String
getComment()
java.lang.String
getName()
int
getPriority()
java.util.Set<Role>
getRoles()
java.lang.String
getUserName()
boolean
hasAtLeastPermission(Permission permission, PermissionValue minValue)
boolean
isPermittedToChangePassword()
Is the user allowed to change his password?boolean
isSystemUser()
void
removeRole(Role role)
void
setComment(java.lang.String comment)
void
setName(java.lang.String name)
void
setPassword(java.lang.String newPassword)
-
-
-
Method Detail
-
getUserName
java.lang.String getUserName()
-
isSystemUser
boolean isSystemUser()
-
getPriority
int getPriority()
-
setPassword
void setPassword(java.lang.String newPassword)
-
isPermittedToChangePassword
boolean isPermittedToChangePassword()
Is the user allowed to change his password?- Returns:
- true if the user is allowed to change his password, false otherwise.
-
changePassword
boolean changePassword(java.lang.String oldPassword, java.lang.String newPassword)
-
getName
java.lang.String getName()
-
setName
void setName(java.lang.String name)
-
getComment
java.lang.String getComment()
-
setComment
void setComment(java.lang.String comment)
-
removeRole
void removeRole(Role role)
-
hasAtLeastPermission
boolean hasAtLeastPermission(Permission permission, PermissionValue minValue)
-
ensureAtLeastPermission
boolean ensureAtLeastPermission(Permission permission, PermissionValue minValue)
Checks if the current user has the permission. If not, show a message dialog if not headless. Otherwise log a message.- Parameters:
permission
- the permission to checkminValue
- the minimum value- Returns:
- true if the user has the permission, false otherwise
-
-