Overview

Namespaces

  • LeanCloud
    • Engine
    • Operation
    • Storage
    • Uploader

Classes

  • ACL
  • AppRouter
  • Bytes
  • Client
  • File
  • GeoPoint
  • LeanObject
  • MIMEType
  • Push
  • Query
  • Region
  • Relation
  • Role
  • RouteCache
  • SaveOption
  • SMS
  • User

Exceptions

  • BatchRequestError
  • CloudException
  • Overview
  • Namespace
  • Class

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
Extended by LeanCloud\Role
Namespace: LeanCloud
See: LeanCloud\ACL, LeanCloud\Relation
Located at LeanCloud/Role.php
Methods summary
public LeanCloud\Role
# setName( $name )

Set name of role

Set name of role

The name can contain only alphanumeric characters, _, -, and space. It cannot be changed after being saved.

Returns

LeanCloud\Role
public string
# getName( )

Get name of role

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

LeanCloud\Relation
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

LeanCloud\Relation
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

Table name on LeanCloud

Table name on LeanCloud

# "_Role"
Properties inherited from LeanCloud\LeanObject
$PRESERVED_KEYS
API documentation generated by ApiGen