Provides an interface for working with and operating on roles.

Using Roles

In OrientDB, roles allow you to assign privileges to a user in bulk rather than individually. For instance, an account that needs to manage a blog would need read and write permissions on certain classes. Roles allow you to give a new account the privileges it needs to function in one command, rather than through a series of individual grants.

To operate on roles in your application, import the class:

import com.orientechnologies.orient.core.metadata.security.OSecurityRole;


MethodReturn TypeDescription
addRule()OSecurityRoleGrants privilege on the given resource
allow()booleanDetermines whether role can perform the given operation on the given resource
getDocument()ODocumentRetrieves the internal document of the role
getName()StringRetrieves the logical name of the role
getParentRole()OSecurityRoleRetrieves the parent role
getRuleSetSet<ORule>Retrieves the rules assigned to the role
grant()OSecurityRoleGrants privileges on the given resource
hasRule()booleanDetermines whether the role can access the given resource
revoke()OSecurityRoleRevokes access to the given resource
setParentRole()OSecurityRoleSets the parent role