Package jmri.jmrit.permission
Class DefaultUser
java.lang.Object
jmri.jmrit.permission.DefaultUser
- All Implemented Interfaces:
User
The default implementation of User.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUser(String username, String password) DefaultUser(String username, String password, int priority, String systemUserName, Role[] roles) DefaultUser(String username, String passwordMD5, String seed) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanchangePassword(String oldPassword, String newPassword) booleancheckPassword(String password) booleanensureAtLeastPermission(Permission permission, PermissionValue minValue) Checks if the current user has the permission.getName()(package private) Stringintstatic StringgetRandomString(int count) getRoles()(package private) StringgetSeed()(package private) StringbooleanhasAtLeastPermission(Permission permission, PermissionValue minValue) booleanIs the user allowed to change his password?booleanvoidremoveRole(Role role) voidsetComment(String comment) voidvoidsetPassword(String newPassword) (package private) voidsetPasswordMD5(String passwordMD5) (package private) void(package private) void
-
Constructor Details
-
DefaultUser
-
DefaultUser
-
DefaultUser
DefaultUser(String username, String password, int priority, String systemUserName, Role[] roles) -
DefaultUser
-
-
Method Details
-
getRandomString
-
getUserName
- Specified by:
getUserNamein interfaceUser
-
isSystemUser
- Specified by:
isSystemUserin interfaceUser
-
getPriority
- Specified by:
getPriorityin interfaceUser
-
getSystemUsername
-
getPassword
-
setPasswordMD5
-
getSeed
-
setSeed
-
getName
-
setName
-
getComment
- Specified by:
getCommentin interfaceUser
-
setComment
- Specified by:
setCommentin interfaceUser
-
getRoles
-
addRole
-
removeRole
- Specified by:
removeRolein interfaceUser
-
setRoles
-
setPassword
- Specified by:
setPasswordin interfaceUser
-
isPermittedToChangePassword
Description copied from interface:UserIs the user allowed to change his password?- Specified by:
isPermittedToChangePasswordin interfaceUser- Returns:
- true if the user is allowed to change his password, false otherwise.
-
changePassword
- Specified by:
changePasswordin interfaceUser
-
checkPassword
-
hasAtLeastPermission
- Specified by:
hasAtLeastPermissionin interfaceUser
-
ensureAtLeastPermission
Description copied from interface:UserChecks if the current user has the permission. If not, show a message dialog if not headless. Otherwise log a message.- Specified by:
ensureAtLeastPermissionin interfaceUser- Parameters:
permission- the permission to checkminValue- the minimum value- Returns:
- true if the user has the permission, false otherwise
-