Class Role
Role representation on LeanCloud
A role represents a group of users in ACL, where a role can be
assigned read/write permissions. If a role was granted write
permission, then users belongs to this role will all inherit the
write permission.
All users of a role could be queried by $role->getUsers()
, which
is an instance of Relation, where users can be added or
removed.
Roles can belong to role as well, which can be got by
$role->getRoles()
, where roles can be added or removed.
-
LeanCloud\LeanObject
-
LeanCloud\Role
Methods summary
public
LeanCloud\Role
|
#
setName( $name )
Set name of role
The name can contain only alphanumeric characters, _, -, and
space. It cannot be changed after being saved.
Returns
|
public
string
|
#
getName( )
Get name of role
Returns
string
|
public
LeanCloud\Relation
|
#
getUsers( )
Get a relation of users that belongs to this role
Get a relation of users that belongs to this role
Returns
|
public
LeanCloud\Relation
|
#
getRoles( )
Get a relation of roles that belongs to this role
Get a relation of roles that belongs to this role
Returns
|
Methods inherited from LeanCloud\LeanObject
__construct(),
addIn(),
addUniqueIn(),
create(),
delete(),
destroy(),
destroyAll(),
disableAfterHook(),
disableBeforeHook(),
fetch(),
fetchAll(),
findUnsavedChildren(),
get(),
getACL(),
getClassName(),
getCreatedAt(),
getObjectId(),
getPointer(),
getQuery(),
getRelation(),
getUpdatedAt(),
hasData(),
increment(),
isDirty(),
mergeAfterFetch(),
mergeAfterSave(),
registerClass(),
removeIn(),
save(),
saveAll(),
set(),
setACL(),
toFullJSON(),
toJSON(),
traverse()
|
Properties summary
protected static
string
|
$className
|
|