API Docs for:

Class Parse.Role

Represents a Role on the Parse server. Roles represent groupings of Users for the purposes of granting permissions (e.g. specifying an ACL for an Object). Roles are specified by their sets of child users and child roles, all of which are granted any permissions that the parent role has.

Roles must have a name (which cannot be changed after creation of the role), and must specify an ACL.

Parse.Role( name, acl )
Parameters:
  • name <String>

    The name of the Role to create.

  • acl <Parse.ACL>

    The ACL for this role. Roles must have an ACL. A Parse.Role is a local representation of a role persisted to the Parse cloud.

String getName( )

Gets the name of the role. You can alternatively call role.get("name")


Returns: <String>

the name of the role.

Parse.Relation getRoles( )

Gets the Parse.Relation for the Parse.Roles that are direct children of this role. These roles' users are granted any privileges that this role has been granted (e.g. read or write access through ACLs). You can add or remove child roles from this role through this relation.

This is equivalent to calling role.relation("roles")


Returns: <Parse.Relation>

the relation for the roles belonging to this role.

Parse.Relation getUsers( )

Gets the Parse.Relation for the Parse.Users that are direct children of this role. These users are granted any privileges that this role has been granted (e.g. read or write access through ACLs). You can add or remove users from the role through this relation.

This is equivalent to calling role.relation("users")


Returns: <Parse.Relation>

the relation for the users belonging to this role.

setName( name, options )

Sets the name for a role. This value must be set before the role has been saved to the server, and cannot be set once the role has been saved.

A role's name can only contain alphanumeric characters, _, -, and spaces.

This is equivalent to calling role.set("name", name)

Parameters:
  • name <String>

    The name of the role.

  • options <Object>

    Standard options object with success and error callbacks.