Drupal 8  8.0.2
RoleInterface Interface Reference
Inheritance diagram for RoleInterface:

Public Member Functions

 getPermissions ()
 
 hasPermission ($permission)
 
 grantPermission ($permission)
 
 revokePermission ($permission)
 
 isAdmin ()
 
 setIsAdmin ($is_admin)
 
 getWeight ()
 
 setWeight ($weight)
 
- Public Member Functions inherited from ConfigEntityInterface
 enable ()
 
 disable ()
 
 setStatus ($status)
 
 setSyncing ($status)
 
 status ()
 
 isSyncing ()
 
 isUninstalling ()
 
 get ($property_name)
 
 set ($property_name, $value)
 
 calculateDependencies ()
 
 onDependencyRemoval (array $dependencies)
 
 getDependencies ()
 
 isInstallable ()
 
 trustData ()
 
 hasTrustedData ()
 
- Public Member Functions inherited from EntityInterface
 uuid ()
 
 id ()
 
 language ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=array())
 
 toUrl ($rel= 'canonical', array $options=array())
 
 url ($rel= 'canonical', $options=array())
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($key)
 
 uriRelationships ()
 
 save ()
 
 delete ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 createDuplicate ()
 
 getEntityType ()
 
 referencedEntities ()
 
 getOriginalId ()
 
 getCacheTagsToInvalidate ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from AccessibleInterface
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 
- Public Member Functions inherited from ThirdPartySettingsInterface
 setThirdPartySetting ($module, $key, $value)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 getThirdPartySettings ($module)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 

Data Fields

const ANONYMOUS_ID = AccountInterface::ANONYMOUS_ROLE
 
const AUTHENTICATED_ID = AccountInterface::AUTHENTICATED_ROLE
 

Additional Inherited Members

- Static Public Member Functions inherited from EntityInterface
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 

Detailed Description

Provides an interface defining a user role entity.

Member Function Documentation

getPermissions ( )

Returns a list of permissions assigned to the role.

Returns
array The permissions assigned to the role.

Implemented in Role.

getWeight ( )

Returns the weight.

Returns
int The weight of this role.

Implemented in Role.

grantPermission (   $permission)

Grant permissions to the role.

Parameters
string$permissionThe permission to grant.
Returns
$this

Implemented in Role.

hasPermission (   $permission)

Checks if the role has a permission.

Parameters
string$permissionThe permission to check for.
Returns
bool TRUE if the role has the permission, FALSE if not.

Implemented in Role.

isAdmin ( )

Indicates that a role has all available permissions.

Returns
bool TRUE if the role has all permissions.

Implemented in Role.

revokePermission (   $permission)

Revokes a permissions from the user role.

Parameters
string$permissionThe permission to revoke.
Returns
$this

Implemented in Role.

setIsAdmin (   $is_admin)

Sets the role to be an admin role.

Parameters
bool$is_adminTRUE if the role should be an admin role.
Returns
$this

Implemented in Role.

setWeight (   $weight)

Sets the weight to the given value.

Parameters
int$weightThe desired weight.
Returns
$this

Implemented in Role.

Field Documentation

const ANONYMOUS_ID = AccountInterface::ANONYMOUS_ROLE

Role ID for anonymous users; should match what's in the "role" table.

Referenced by User\addRole(), RoleAccessControlHandler\checkAccess(), UserSessionTest\createUserSession(), User\getRoles(), User\preSave(), EntityViewBuilderTest\setUp(), UserCacheTagsTest\setUp(), FeedCacheTagsTest\setUp(), ShortcutCacheTagsTest\setUp(), ItemCacheTagsTest\setUp(), TourCacheTagsTest\setUp(), CommentUserNameTest\setUp(), CommentCacheTagsTest\setUp(), CommentNonNodeTest\setUp(), EntityCacheTagsTestBase\setUp(), UserRoleConditionTest\setUp(), EntityReferenceFormatterTest\testAccess(), CommentFieldAccessTest\testAccessToAdministrativeFields(), ContactPersonalTest\testAdminContact(), CommentAnonymousTest\testAnonymous(), CommentAdminTest\testApprovalAdminInterface(), CommentAdminTest\testApprovalNodeInterface(), ContactSitewideTest\testAutoReply(), BookTest\testBookExport(), BookTest\testBookNavigationBlock(), CommentInterfaceTest\testCommentInterface(), CommentLinksTest\testCommentLinks(), CommentStatisticsTest\testCommentNodeCommentStatistics(), ActionUnitTest\testDependencies(), CommentAdminTest\testEditComment(), FilterAdminTest\testFilterAdmin(), FilterHooksTest\testFilterHooks(), ImageFieldDisplayTest\testImageFieldFormattersPrivate(), FilterDefaultConfigTest\testInstallation(), BookTest\testNavigationBlockOnAccessModuleInstalled(), NodeAccessMenuLinkTest\testNodeAccessMenuLink(), PageCacheTest\testPageCacheAnonymousRolePermissions(), ContactPersonalTest\testPersonalContactAccess(), CommentBlockTest\testRecentCommentBlock(), NodeBlockFunctionalTest\testRecentNodeBlock(), ResponsiveImageFieldDisplayTest\testResponsiveImageFieldFormattersPrivate(), UserRoleAdminTest\testRoleAdministration(), SearchCommentTest\testSearchResultsComment(), SearchCommentTest\testSearchResultsCommentAccess(), ContactSitewideTest\testSiteWideContact(), FilterDefaultConfigTest\testUpdateRoles(), AnonymousUserSessionTest\testUserGetRoles(), and UserTest\testUserGetRoles().


The documentation for this interface was generated from the following file: