public final class ClassPrivileges extends Object
Constructor and Description |
---|
ClassPrivileges(long privileges) |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreate()
Returns whether or not this user is allowed to create objects of this type.
|
boolean |
canQuery()
Returns whether or not the user can query the given class.
|
boolean |
canRead()
Returns whether or not the user can read objects of this type.
|
boolean |
canSetPermissions()
Returns whether or not the user can change the
ClassPermissions object representing
the given class. |
boolean |
canUpdate()
Returns whether or not the user can update objects of the given type.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
public boolean canRead()
If false
, the current User is not permitted to see objects of this type, and
+ attempting to query this class will always return empty results.
+
+ Note that Read permissions are transitive, and so it may be possible to read an + object which the user does not directly have Read permissions for by following a + link to it from an object they do have Read permissions for. This does not apply + to any of the other permission types.
true
if the user can read objects of the given type, false
if not.public boolean canUpdate()
If true
, the user is allowed to update properties on all objects of this type in
the Realm. This does not include updating permissions nor creating or deleting objects.
true
if the user can update objects of the given type, false
if not.public boolean canSetPermissions()
ClassPermissions
object representing
the given class. See this clas for further details.true
if the user can modify the ClassPermissions
object for the given
class, false
if not.ClassPermissions
public boolean canQuery()
If this returns false
, queries can still be run, but they will always return the
empty result. This can be useful to prevent people from querying leaf objects in a tree
structure and force them to only access objects through some parent objects that reference
them.
true
if the user can query the given class, false
if not.public boolean canCreate()
true
if the user can create objects of this type, false
if not.