public class WGACL
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
VALID_ROLENAME_CHARS
String containing all characters a role name may consist of
|
| Modifier and Type | Method and Description |
|---|---|
WGACLEntry |
createEntry(java.lang.String name,
int type,
int accessLevel)
Creates a new ACL entry, that defines the access right for a user, group or role.
|
WGACLEntry |
createRoleEntry(java.lang.String name)
Creates a new role entry in the ACL
|
WGACLEntry |
createUserEntry(java.lang.String name,
int accessLevel)
Creates a new ACL entry, that defines the access right for a user or group.
|
java.util.List |
getAllEntries()
Returns all ACL entries in this ACL.
|
WGACLEntry |
getEntry(java.lang.String name)
Returns the entry for a given name
|
java.util.List |
getOwnersOfRole(WGACLEntry roleEntry)
Gets all the acl entries that are members of a specific role.
|
java.util.Map |
getRoles()
Returns all roles in this ACL.
|
java.util.Map |
getUsers()
Returns all user/group entries of this ACL.
|
static boolean |
isValidRoleName(java.lang.String name)
Determines if a name is a valid role name.
|
WGACLEntryFlags |
parseFlags(WGACLEntry entry)
Parses the given flags and returns a WGACLEntryFlags containing the parsed flag information
|
void |
remove(WGACLEntry entry)
Removes the given ACL entry from the ACL.
|
void |
save(WGACLEntry entry)
Saves the given ACL entry.
|
public static final java.lang.String VALID_ROLENAME_CHARS
public java.util.Map getUsers()
throws WGAPIException
WGAPIExceptionpublic java.util.Map getRoles()
throws WGAPIException
WGAPIExceptionpublic java.util.List getAllEntries()
throws WGAPIException
WGAPIExceptionpublic WGACLEntry getEntry(java.lang.String name) throws WGAPIException
name - Name of user or groupWGAPIExceptionpublic WGACLEntry createEntry(java.lang.String name, int type, int accessLevel) throws WGAPIException, WGAuthorisationException, WGBackendException
name - Name of the user, group or role.type - Type of entry. User constants WGACLEntry.TYPE_.... Not used yet since there are no roles till now.accessLevel - The Access level for the user. Use constants WGDatabase.ACCESSLEVEL_....WGCreationException - If something went wrong in the background creation process.WGAuthorisationException - If you are not authorized to create entries.WGAPIExceptionWGBackendExceptionpublic WGACLEntry createRoleEntry(java.lang.String name) throws WGAuthorisationException, WGBackendException, WGAPIException
name - Name of the role. See isValidRoleName(java.lang.String) for valid role namesWGAuthorisationExceptionWGAPIExceptionWGAPIExceptionWGBackendExceptionpublic WGACLEntry createUserEntry(java.lang.String name, int accessLevel) throws WGAPIException
name - Name of user or groupaccessLevel - The Access level for the user. Use constants WGDatabase.ACCESSLEVEL_....WGCreationException - If something went wrong in the background creation process.WGAuthorisationException - If you are not authorized to create entries.WGAPIExceptionpublic void remove(WGACLEntry entry) throws WGAPIException
entry - The entry to removeWGAuthorisationException - If you are not authorized to do thisWGAPIExceptionpublic void save(WGACLEntry entry) throws WGAPIException
entry - The entry to save.WGAuthorisationException - If you are not authorized to do thisWGAPIExceptionpublic WGACLEntryFlags parseFlags(WGACLEntry entry) throws WGIllegalDataException
entry - The entry whose flags are parsedWGIllegalDataExceptionpublic static boolean isValidRoleName(java.lang.String name)
name - The role name candidatepublic java.util.List getOwnersOfRole(WGACLEntry roleEntry) throws WGAPIException
roleEntry - The entry of the role whose members are searchedWGAPIException