public class LCACL extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LCACL.Permissions |
Constructor and Description |
---|
LCACL() |
LCACL(HashMap data)
constructor
|
LCACL(JSONObject json) |
LCACL(LCACL other)
copy constructor
|
LCACL(LCUser owner)
constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Map<String,LCACL.Permissions> |
getPermissionsById()
get permissions by id.
|
boolean |
getPublicReadAccess()
Get whether the public is allowed to read this object.
|
boolean |
getPublicWriteAccess()
Set whether the public is allowed to write this object.
|
boolean |
getReadAccess(LCUser user)
Get whether the given user is *explicitly* allowed to read this object.
|
boolean |
getReadAccess(String userId)
Get whether the given user id is *explicitly* allowed to read this object.
|
boolean |
getRoleReadAccess(String role)
Get whether the given role is *explicitly* allowed to read this object.
|
boolean |
getRoleWriteAccess(String role)
Get whether the given role is *explicitly* allowed to write this object.
|
boolean |
getWriteAccess(LCUser user)
Get whether the given user is *explicitly* allowed to write this object.
|
boolean |
getWriteAccess(String userId)
Get whether the given user id is *explicitly* allowed to write this object.
|
int |
hashCode() |
void |
setPublicReadAccess(boolean allowed)
Set whether the public is allowed to read this object.
|
void |
setPublicWriteAccess(boolean allowed)
Set whether the public is allowed to write this object.
|
void |
setReadAccess(LCUser user,
boolean allowed)
Set whether the given user is allowed to read this object.
|
void |
setReadAccess(String userId,
boolean allowed)
Set whether the given user id is allowed to read this object.
|
void |
setRoleReadAccess(String role,
boolean allowed)
Set whether the given role is allowed to read this object.
|
void |
setRoleWriteAccess(String role,
boolean allowed)
Set whether the given role is allowed to write this object.
|
void |
setWriteAccess(LCUser user,
boolean allowed)
Set whether the given user is allowed to write this object.
|
void |
setWriteAccess(String userId,
boolean allowed)
Set whether the given user id is allowed to write this object.
|
JSONObject |
toJSONObject()
get json object.
|
public LCACL()
public LCACL(JSONObject json)
public LCACL(HashMap data)
data
- hash map for acl.public LCACL(LCACL other)
other
- other instancepublic LCACL(LCUser owner)
owner
- owner with read/write permission.public Map<String,LCACL.Permissions> getPermissionsById()
public JSONObject toJSONObject()
public void setPublicReadAccess(boolean allowed)
allowed
- flag to allow.public boolean getPublicReadAccess()
public void setPublicWriteAccess(boolean allowed)
allowed
- flag to allowpublic boolean getPublicWriteAccess()
public void setReadAccess(String userId, boolean allowed)
userId
- target user id.allowed
- flag to allowpublic boolean getReadAccess(String userId)
false
, the user may still be able to access it if getPublicReadAccess returns
true
or a role that the user belongs to has read access.userId
- target user id.public void setWriteAccess(String userId, boolean allowed)
userId
- target user id.allowed
- flag to allow.public boolean getWriteAccess(String userId)
false
, the user may still be able to write it if getPublicWriteAccess returns
true
or a role that the user belongs to has write access.userId
- target user id.public void setReadAccess(LCUser user, boolean allowed)
user
- target user.allowed
- flag to allowpublic boolean getReadAccess(LCUser user)
false
, the user may still be able to access it if getPublicReadAccess returns
true
or a role that the user belongs to has read access.user
- target user.public void setWriteAccess(LCUser user, boolean allowed)
user
- target user.allowed
- flag to allowpublic boolean getWriteAccess(LCUser user)
false
, the user may still be able to access it if getPublicWriteAccess returns
true
or a role that the user belongs to has write access.user
- target user.public void setRoleReadAccess(String role, boolean allowed)
role
- target role.allowed
- flat to allow.public boolean getRoleReadAccess(String role)
false
, the role may still be able to access it if getPublicReadAccess returnsrole
- target role.public void setRoleWriteAccess(String role, boolean allowed)
role
- target role.allowed
- flat to allow.public boolean getRoleWriteAccess(String role)
false
, the role may still be able to access it if getPublicWriteAccess returnsrole
- target role.Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.