public class AccessControlList extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AccessControlList.Builder |
| Modifier and Type | Field and Description |
|---|---|
static String |
CREATE |
static String |
DELETE |
static String |
READ |
static String |
UPDATE |
| Constructor and Description |
|---|
AccessControlList()
Construct an empty ACL
|
AccessControlList(AccessControlList that)
Construct an empty ACL
|
AccessControlList(AclUpdateListener listener)
Construct an ACL with the given update listener
|
| Modifier and Type | Method and Description |
|---|---|
AccessControlList |
addAclEntry(AccessControlEntry acle)
Add the given ACL entry to this ACL's list of entries.
|
org.json.JSONObject |
asJson()
Serialize to JSON
|
static AccessControlList.Builder |
builder()
Create a builder for an ACL
|
boolean |
canUser(Identity user,
String op)
Can the given user perform the given operation based on this ACL?
|
boolean |
canUser(String userId,
Set<String> groups,
String op)
Can the given user ID or group set perform the given operation based on this ACL?
|
AccessControlList |
clear()
Clear all entries from this ACL and notify the listener if present
|
AccessControlList |
clear(String userOrGroupId,
String... ops)
Clear matching entries.
|
static AccessControlList |
createOpenAcl()
Return an ACL that allows any user to perform any operation
|
AccessControlList |
deny(String userOrGroupId,
String... ops)
Deny the given ID from performing the given operations by adding a new entry to the end of the ACL entry list.
|
static AccessControlList |
deserialize(org.json.JSONObject o,
AclUpdateListener listener)
Deserialize a JSON object created by serialize() or asJson()
|
static AccessControlList |
deserialize(String s,
AclUpdateListener listener)
Deserialize a string created by serialize()
|
List<AccessControlEntry> |
getEntries()
Get the list of ACL entries on this ACL
|
AclUpdateListener |
getListener()
Get the listener on this ACL if present
|
String |
getOwner()
Get the owner ID for this ACL
|
static AccessControlList |
initialize(AclUpdateListener listener) |
AccessControlList |
permit(String userOrGroupId,
String... ops)
Permit the given ID to perform the given operations by adding a new entry to the end of the ACL entry list.
|
String |
serialize()
Serialize to a JSON String
|
AccessControlList |
setOwner(String userOrGroupId)
Set the owner ID for this ACL.
|
String |
toString() |
public static final String CREATE
public static final String READ
public static final String UPDATE
public static final String DELETE
public AccessControlList()
public AccessControlList(AccessControlList that)
public AccessControlList(AclUpdateListener listener)
listener - a listener, which may be nullpublic static AccessControlList.Builder builder()
public static AccessControlList createOpenAcl()
public String getOwner()
public AccessControlList setOwner(String userOrGroupId)
userOrGroupId - The ID to use as owner. This may be null.public AccessControlList permit(String userOrGroupId, String... ops)
userOrGroupId - the user or group IDops - one or more operationspublic AccessControlList deny(String userOrGroupId, String... ops)
userOrGroupId - the user or group IDops - one or more operationspublic AccessControlList clear(String userOrGroupId, String... ops)
userOrGroupId - the user or group to clear entries forops - the operations to clear entries forpublic AccessControlList clear()
public List<AccessControlEntry> getEntries()
public boolean canUser(Identity user, String op) throws IamSvcException
user - a userop - an operationIamSvcException - if there's an error during processingpublic boolean canUser(String userId, Set<String> groups, String op)
userId - a user IDgroups - a set of 0 or more groupsop - an operationpublic AccessControlList addAclEntry(AccessControlEntry acle)
acle - an ACL entrypublic org.json.JSONObject asJson()
public String serialize()
public static AccessControlList initialize(AclUpdateListener listener)
public static AccessControlList deserialize(String s, AclUpdateListener listener)
s - a string serialized ACLlistener - an optional listenerpublic static AccessControlList deserialize(org.json.JSONObject o, AclUpdateListener listener)
o - a JSON object serialized ACLlistener - an optional listenerpublic AclUpdateListener getListener()
Copyright © 2023 continual.io. All rights reserved.