程序包 cn.leancloud
类 LCACL
- java.lang.Object
-
- cn.leancloud.LCACL
-
public class LCACL extends java.lang.Object
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classLCACL.Permissions
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object o)java.util.Map<java.lang.String,LCACL.Permissions>getPermissionsById()get permissions by id.booleangetPublicReadAccess()Get whether the public is allowed to read this object.booleangetPublicWriteAccess()Set 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(java.lang.String userId)Get whether the given user id is *explicitly* allowed to read this object.booleangetRoleReadAccess(java.lang.String role)Get whether the given role is *explicitly* allowed to read this object.booleangetRoleWriteAccess(java.lang.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(java.lang.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(java.lang.String userId, boolean allowed)Set whether the given user id is allowed to read this object.voidsetRoleReadAccess(java.lang.String role, boolean allowed)Set whether the given role is allowed to read this object.voidsetRoleWriteAccess(java.lang.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(java.lang.String userId, boolean allowed)Set whether the given user id is allowed to write this object.JSONObjecttoJSONObject()get json object.
-
-
-
构造器详细资料
-
LCACL
public LCACL()
-
LCACL
public LCACL(JSONObject json)
-
LCACL
public LCACL(java.util.HashMap data)
constructor- 参数:
data- hash map for acl.
-
LCACL
public LCACL(LCACL other)
copy constructor- 参数:
other- other instance
-
LCACL
public LCACL(LCUser owner)
constructor- 参数:
owner- owner with read/write permission.
-
-
方法详细资料
-
getPermissionsById
public java.util.Map<java.lang.String,LCACL.Permissions> getPermissionsById()
get permissions by id.- 返回:
- hash map for id and permission.
-
equals
public boolean equals(java.lang.Object o)
- 覆盖:
equals在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
toJSONObject
public JSONObject toJSONObject()
get json object.- 返回:
- json object.
-
setPublicReadAccess
public void setPublicReadAccess(boolean allowed)
Set whether the public is allowed to read this object.- 参数:
allowed- flag to allow.
-
getPublicReadAccess
public boolean getPublicReadAccess()
Get whether the public is allowed to read this object.- 返回:
- public read permission.
-
setPublicWriteAccess
public void setPublicWriteAccess(boolean allowed)
Set whether the public is allowed to write this object.- 参数:
allowed- flag to allow
-
getPublicWriteAccess
public boolean getPublicWriteAccess()
Set whether the public is allowed to write this object.- 返回:
- public write permission.
-
setReadAccess
public void setReadAccess(java.lang.String userId, boolean allowed)Set whether the given user id is allowed to read this object.- 参数:
userId- target user id.allowed- flag to allow
-
getReadAccess
public boolean getReadAccess(java.lang.String userId)
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.- 参数:
userId- target user id.- 返回:
- result whether has read permission for specified userId.
-
setWriteAccess
public void setWriteAccess(java.lang.String userId, boolean allowed)Set whether the given user id is allowed to write this object.- 参数:
userId- target user id.allowed- flag to allow.
-
getWriteAccess
public boolean getWriteAccess(java.lang.String userId)
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.- 参数:
userId- target user id.- 返回:
- result whether has write permission for specified userId.
-
setReadAccess
public void setReadAccess(LCUser user, boolean allowed)
Set whether the given user is allowed to read this object.- 参数:
user- target user.allowed- flag to allow
-
getReadAccess
public boolean getReadAccess(LCUser user)
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.- 参数:
user- target user.- 返回:
- result whether has read permission for specified user.
-
setWriteAccess
public void setWriteAccess(LCUser user, boolean allowed)
Set whether the given user is allowed to write this object.- 参数:
user- target user.allowed- flag to allow
-
getWriteAccess
public boolean getWriteAccess(LCUser user)
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.- 参数:
user- target user.- 返回:
- result whether has write permission for specified user.
-
setRoleReadAccess
public void setRoleReadAccess(java.lang.String role, boolean allowed)Set whether the given role is allowed to read this object.- 参数:
role- target role.allowed- flat to allow.
-
getRoleReadAccess
public boolean getRoleReadAccess(java.lang.String role)
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- 参数:
role- target role.- 返回:
- result whether has read permission for specified role.
-
setRoleWriteAccess
public void setRoleWriteAccess(java.lang.String role, boolean allowed)Set whether the given role is allowed to write this object.- 参数:
role- target role.allowed- flat to allow.
-
getRoleWriteAccess
public boolean getRoleWriteAccess(java.lang.String role)
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- 参数:
role- target role.- 返回:
- result whether has write permission for specified role.
-
-