public final class Permission extends Object
path
.
Permissions can be changed by users with administrative rights using SyncUser.applyPermissions(PermissionRequest)
.
Constructor and Description |
---|
Permission(String userId,
String path,
AccessLevel accessLevel,
boolean mayRead,
boolean mayWrite,
boolean mayManage,
Date updatedAt) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
AccessLevel |
getAccessLevel()
Returns the access level granted by this permission.
|
String |
getPath()
Returns the path to the Realm on the server effected by this permission.
|
Date |
getUpdatedAt()
Returns the timestamp for when this permission object was last updated.
|
String |
getUserId()
Returns the
SyncUser.getIdentity() of the user effected by this permission or
null if this permissions applies to all users. |
int |
hashCode() |
boolean |
mayManage()
Checks whether or not the user defined by this permission is allowed to manage access to the Realm defined
by
getPath() . |
boolean |
mayRead()
Checks whether or not the user defined by this permission is allowed to read the Realm defined by
getPath() . |
boolean |
mayWrite()
Checks whether or not the user defined by this permission is allowed to write to the Realm defined by
getPath() . |
String |
toString() |
public Permission(String userId, String path, AccessLevel accessLevel, boolean mayRead, boolean mayWrite, boolean mayManage, Date updatedAt)
public String getUserId()
SyncUser.getIdentity()
of the user effected by this permission or
null
if this permissions applies to all users.public String getPath()
public AccessLevel getAccessLevel()
public boolean mayRead()
getPath()
.true
if this permission grant read permissions to the Realm, false
if not.public boolean mayWrite()
getPath()
.true
if this permission grant write permissions to the Realm, false
if not.public boolean mayManage()
getPath()
. Having this permission enable those users to add or remove permissions from
other users, including the one who granted it.true
if this permission grant administrative rights to the Realm, false
if not.public Date getUpdatedAt()