public static class Permission.Builder extends Object
Permission
object in a fluid manner.Constructor and Description |
---|
Builder(Role role)
Creates the builder.
|
Modifier and Type | Method and Description |
---|---|
Permission.Builder |
allPrivileges()
Enables all privileges.
|
Permission |
build()
Creates the unmanaged
Permission object. |
Permission.Builder |
canCreate(boolean canCreate)
Defines if this role is allowed to create objects of this type.
|
Permission.Builder |
canDelete(boolean canDelete)
Defines if this role can delete the given resource or not.
|
Permission.Builder |
canModifySchema(boolean canModifySchema)
Defines if this role is allowed to modify the schema of this resource.
|
Permission.Builder |
canQuery(boolean canQuery)
Defines if this role is allowed to query the resource or not.
|
Permission.Builder |
canRead(boolean canRead)
Defines if this role can read from given resource or not.
|
Permission.Builder |
canSetPermissions(boolean canSetPermissions)
Defines if this role is allowed to change permissions on the given resource.
|
Permission.Builder |
canUpdate(boolean canUpdate)
Defines if this role can update the given resource or not.
|
Permission.Builder |
noPrivileges()
Disables all privileges.
|
public Permission.Builder allPrivileges()
public Permission.Builder noPrivileges()
public Permission.Builder canRead(boolean canRead)
false
, the
Realm will appear completely empty to the role, effectively making it inaccessible.
false
.
If false
, the role cannot see any object of this type and all queries
against the type will return no results.
canRead
- true
if the role is allowed to read this resource, false
if not.public Permission.Builder canUpdate(boolean canUpdate)
true
, the role is allowed update properties on all objects in the Realm.
This does not include updating permissions nor creating or deleting objects.
true
, the role is allowed update properties on all objects of this type in
the Realm. This does not include updating permissions nor creating or deleting objects.
true
, the role is allowed to update properties on the object. This
does not cover updating permissions or deleting the object.
canUpdate
- true
if the role is allowed to update this resource, false
if not.public Permission.Builder canDelete(boolean canDelete)
true
, the role is allowed to delete the object.
canDelete
- true
if the role is allowed to delete this resource, false
if not.public Permission.Builder canSetPermissions(boolean canSetPermissions)
RealmPermissions
object.
ClassPermissions
object.
canSetPermissions
- true
if the role is allowed to change the permissions for this resource.public Permission.Builder canQuery(boolean canQuery)
Note, that local queries are always possible, but the query result will just be empty.
canQuery
- true
if the role is allowed to query objects of this type.public Permission.Builder canCreate(boolean canCreate)
true
, the role is allowed to create objects of this type.
canCreate
- true
if the role is allowed to create objects of this type.public Permission.Builder canModifySchema(boolean canModifySchema)
true
the role is allowed to create classes in the Realm.
true
, the role is allowed to add properties to the specified class.
canModifySchema
- true
if the role is allowed to modify the schema of this resource.public Permission build()
Permission
object.