Class OUser
java.lang.Object
com.orientechnologies.orient.core.type.ODocumentWrapper
com.orientechnologies.orient.core.metadata.security.OIdentity
com.orientechnologies.orient.core.metadata.security.OUser
- All Implemented Interfaces:
OSecurityUser,Serializable
- Direct Known Subclasses:
OSystemUser
Contains the user settings about security and permissions. Each user has one or more roles
associated. Roles contains the permission rules that define what the user can access and what he
cannot.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.orientechnologies.orient.core.metadata.security.OSecurityUser
OSecurityUser.STATUSES -
Field Summary
FieldsFields inherited from class com.orientechnologies.orient.core.type.ODocumentWrapper
documentFields inherited from interface com.orientechnologies.orient.core.metadata.security.OSecurityUser
DATABASE_USER_TYPE, SECURITY_USER_TYPE, SERVER_USER_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRole(OSecurityRole iRole) allow(ORule.ResourceGeneric resourceGeneric, String resourceSpecific, int iOperation) Checks if the user has the permission to access to the requested resource for the requested operation.Deprecated.checkIfAllowed(ORule.ResourceGeneric resourceGeneric, String resourceSpecific, int iOperation) Checks if the user has the permission to access to the requested resource for the requested operation.checkIfAllowed(String iResource, int iOperation) Deprecated.booleancheckPassword(String iPassword) protected ORolecreateRole(ODocument roleDoc) Derived classes can override createRole() to return an extended ORole implementation or null if the role should not be added.static booleanencodePassword(ODatabaseDocumentInternal session, ODocument iDocument) static final StringencryptPassword(String iPassword) voidfromStream(ODocument iSource) getName()getRoles()booleanbooleanisRuleDefined(ORule.ResourceGeneric resourceGeneric, String resourceSpecific) Checks if a rule was defined for the user.booleanisRuleDefined(String iResource) Deprecated.booleanremoveRole(String iRoleName) save()voidsetAccountStatus(OSecurityUser.STATUSES accountStatus) setPassword(String iPassword) toString()Methods inherited from class com.orientechnologies.orient.core.type.ODocumentWrapper
equals, getDocument, hashCode, load, reload, reload, reload, save, toStream
-
Field Details
-
ADMIN
- See Also:
-
CLASS_NAME
- See Also:
-
PASSWORD_FIELD
- See Also:
-
roles
-
-
Constructor Details
-
OUser
public OUser()Constructor used in unmarshalling. -
OUser
-
OUser
-
OUser
Create the user by reading the source document.
-
-
Method Details
-
encryptPassword
-
encodePassword
-
fromStream
- Overrides:
fromStreamin classODocumentWrapper
-
createRole
Derived classes can override createRole() to return an extended ORole implementation or null if the role should not be added. -
allow
Checks if the user has the permission to access to the requested resource for the requested operation.- Specified by:
allowin interfaceOSecurityUser- Parameters:
iOperation- Requested operation- Returns:
- The role that has granted the permission if any, otherwise a OSecurityAccessException exception is raised
- Throws:
OSecurityAccessException
-
checkIfAllowed
public ORole checkIfAllowed(ORule.ResourceGeneric resourceGeneric, String resourceSpecific, int iOperation) Checks if the user has the permission to access to the requested resource for the requested operation.- Specified by:
checkIfAllowedin interfaceOSecurityUser- Parameters:
iOperation- Requested operation- Returns:
- The role that has granted the permission if any, otherwise null
-
allow
Deprecated.- Specified by:
allowin interfaceOSecurityUser
-
checkIfAllowed
Deprecated.- Specified by:
checkIfAllowedin interfaceOSecurityUser
-
isRuleDefined
Deprecated.- Specified by:
isRuleDefinedin interfaceOSecurityUser
-
isRuleDefined
Checks if a rule was defined for the user.- Specified by:
isRuleDefinedin interfaceOSecurityUser- Returns:
- True is a rule is defined, otherwise false
-
checkPassword
- Specified by:
checkPasswordin interfaceOSecurityUser
-
getName
- Specified by:
getNamein interfaceOSecurityUser
-
setName
- Specified by:
setNamein interfaceOSecurityUser
-
getPassword
- Specified by:
getPasswordin interfaceOSecurityUser
-
setPassword
- Specified by:
setPasswordin interfaceOSecurityUser
-
getAccountStatus
- Specified by:
getAccountStatusin interfaceOSecurityUser
-
setAccountStatus
- Specified by:
setAccountStatusin interfaceOSecurityUser
-
getRoles
- Specified by:
getRolesin interfaceOSecurityUser
-
addRole
- Specified by:
addRolein interfaceOSecurityUser
-
addRole
- Specified by:
addRolein interfaceOSecurityUser
-
removeRole
- Specified by:
removeRolein interfaceOSecurityUser
-
hasRole
- Specified by:
hasRolein interfaceOSecurityUser
-
save
- Overrides:
savein classODocumentWrapper
-
toString
- Overrides:
toStringin classODocumentWrapper
-
getIdentity
- Specified by:
getIdentityin interfaceOSecurityUser
-
getUserType
- Specified by:
getUserTypein interfaceOSecurityUser
-