Package cn.leancloud
Class LCACL
java.lang.Object
cn.leancloud.LCACL
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanget permissions by id.booleanGet whether the public is allowed to read this object.booleanSet whether the public is allowed to write this object.booleangetReadAccess(LCUser user) Get whether the given user is *explicitly* allowed to read this object.booleangetReadAccess(String userId) Get whether the given user id is *explicitly* allowed to read this object.booleangetRoleReadAccess(String role) Get whether the given role is *explicitly* allowed to read this object.booleangetRoleWriteAccess(String role) Get whether the given role is *explicitly* allowed to write this object.booleangetWriteAccess(LCUser user) Get whether the given user is *explicitly* allowed to write this object.booleangetWriteAccess(String userId) Get whether the given user id is *explicitly* allowed to write this object.inthashCode()voidsetPublicReadAccess(boolean allowed) Set whether the public is allowed to read this object.voidsetPublicWriteAccess(boolean allowed) Set whether the public is allowed to write this object.voidsetReadAccess(LCUser user, boolean allowed) Set whether the given user is allowed to read this object.voidsetReadAccess(String userId, boolean allowed) Set whether the given user id is allowed to read this object.voidsetRoleReadAccess(String role, boolean allowed) Set whether the given role is allowed to read this object.voidsetRoleWriteAccess(String role, boolean allowed) Set whether the given role is allowed to write this object.voidsetWriteAccess(LCUser user, boolean allowed) Set whether the given user is allowed to write this object.voidsetWriteAccess(String userId, boolean allowed) Set whether the given user id is allowed to write this object.get json object.
-
Constructor Details
-
LCACL
public LCACL() -
LCACL
-
LCACL
constructor- Parameters:
data- hash map for acl.
-
LCACL
copy constructor- Parameters:
other- other instance
-
LCACL
constructor- Parameters:
owner- owner with read/write permission.
-
-
Method Details
-
getPermissionsById
get permissions by id.- Returns:
- hash map for id and permission.
-
equals
-
hashCode
public int hashCode() -
toJSONObject
get json object.- Returns:
- json object.
-
setPublicReadAccess
public void setPublicReadAccess(boolean allowed) Set whether the public is allowed to read this object.- Parameters:
allowed- flag to allow.
-
getPublicReadAccess
public boolean getPublicReadAccess()Get whether the public is allowed to read this object.- Returns:
- public read permission.
-
setPublicWriteAccess
public void setPublicWriteAccess(boolean allowed) Set whether the public is allowed to write this object.- Parameters:
allowed- flag to allow
-
getPublicWriteAccess
public boolean getPublicWriteAccess()Set whether the public is allowed to write this object.- Returns:
- public write permission.
-
setReadAccess
Set whether the given user id is allowed to read this object.- Parameters:
userId- target user id.allowed- flag to allow
-
getReadAccess
Get whether the given user id is *explicitly* allowed to read this object. Even if this returnsfalse, the user may still be able to access it if getPublicReadAccess returnstrueor a role that the user belongs to has read access.- Parameters:
userId- target user id.- Returns:
- result whether has read permission for specified userId.
-
setWriteAccess
Set whether the given user id is allowed to write this object.- Parameters:
userId- target user id.allowed- flag to allow.
-
getWriteAccess
Get whether the given user id is *explicitly* allowed to write this object. Even if this returnsfalse, the user may still be able to write it if getPublicWriteAccess returnstrueor a role that the user belongs to has write access.- Parameters:
userId- target user id.- Returns:
- result whether has write permission for specified userId.
-
setReadAccess
Set whether the given user is allowed to read this object.- Parameters:
user- target user.allowed- flag to allow
-
getReadAccess
Get whether the given user is *explicitly* allowed to read this object. Even if this returnsfalse, the user may still be able to access it if getPublicReadAccess returnstrueor a role that the user belongs to has read access.- Parameters:
user- target user.- Returns:
- result whether has read permission for specified user.
-
setWriteAccess
Set whether the given user is allowed to write this object.- Parameters:
user- target user.allowed- flag to allow
-
getWriteAccess
Get whether the given user is *explicitly* allowed to write this object. Even if this returnsfalse, the user may still be able to access it if getPublicWriteAccess returnstrueor a role that the user belongs to has write access.- Parameters:
user- target user.- Returns:
- result whether has write permission for specified user.
-
setRoleReadAccess
Set whether the given role is allowed to read this object.- Parameters:
role- target role.allowed- flat to allow.
-
getRoleReadAccess
Get whether the given role is *explicitly* allowed to read this object. Even if this returnsfalse, the role may still be able to access it if getPublicReadAccess returns- Parameters:
role- target role.- Returns:
- result whether has read permission for specified role.
-
setRoleWriteAccess
Set whether the given role is allowed to write this object.- Parameters:
role- target role.allowed- flat to allow.
-
getRoleWriteAccess
Get whether the given role is *explicitly* allowed to write this object. Even if this returnsfalse, the role may still be able to access it if getPublicWriteAccess returns- Parameters:
role- target role.- Returns:
- result whether has write permission for specified role.
-