|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Definition of an Access Control List Manager
The ACL Manager administers the Access Control Lists (ACL).
This interface defines methods which are necessary to administer ACL's and check if a principal has access to an object with a certain permission.
Permissions:
- An permission exists of an object type and an permission name separated by by a point '.' (i.e. "default_type.read" ).
Note: A point is not allowed in the object type, but in the permission name!
- Optional: You can use global permissions (permissions without object type)
- Permissions must be unique within the namespace of the ACL Manager you are using. This means if you use an application specific ACL Manager, the permissions have to be unique within your application. If you use the default ACL Manager, the permission have to be globally unique.
Object Id's:
-They also have to be unique within the namespace of the ACL Manager you are using (see above). Therefore they should have a prefix with the service name and/or the object type.
The following code exsample shows some typical functions:
// Get default ACL Manager
IAclMAnager manager = UMFactory.getAclManager();
// Get specific ACL Manager
IAclMAnager manager = UMFactory.getAclManager("Workflow");
//Create some Permissions
manager.addPermission("WorkflowPermission.read", null);
manager.addPermission("WorkflowPermission.write", null);
//Create a Permission Container
List members = new ArrayList(2);
members.add("WorkflowPermission.read");
members.add("WorkflowPermission.write");
manager.addPermission("WorkflowPermission.full_control", members);
//Create an ACL on an objectID
IUser userA;
IAcl acl = manager.createAcl(userA, "WorkflowItemABC");
//Get this ACL again
IAcl acls = manager.getAcls("WorkflowItemABC");
//Delete an ACL
manager.removeAcl(userA, "WorkflowItemABC");
//Delete all info's abaout a principal (concerning ACL info)
manager.deletePrincipal(usersA);
//Create an ACE (Access Control Entry) for user B (user A is ACL Owner)
IAclEntry aclEntry = acl.createAclEntry(userA, userB, "WorkflowPermission.read", false);
//Get all ACE's for a special principal
acl.getAclEntries(userB);
//Get all ACE's
acl.getAclEntries();
//check a permission on IAclManager
manager.isAllowed("WorkflowItemABC", usersA, "WorkflowPermission.read");
//check a permission on IAcl
acl.isAllowed(usersA, "WorkflowPermission.read");
//check a permission on IAclEntry
acl.isAllowed("WorkflowPermission.read");
//Delete an ACL Entry
acl.removeAclEntry(usersA, aclEntries);
//Reset the hole ACL (only deletion of ACE's)
acl.resetAcl(usersA);
| Field Summary | |
static int |
MAX_OBJECT_ID_LENGTH
Max. |
static int |
MAX_PERMISSION_NAME_LENGTH
Max. |
static java.lang.String |
OWNER_PERMISSION
Permission that an owner of an ACL gets automatically |
| Method Summary | |
boolean |
addPermission(java.lang.String permission,
java.util.List members)
Adds a permission to the list of available permissions. |
boolean |
addPermissionMember(java.lang.String permission,
java.lang.String member)
Adds a member (permission) to an existing permission. |
IAcl |
createAcl(IPrincipal caller,
java.lang.String objectId)
This method creates a new ACL object for an object id. |
void |
deletePrincipal(IPrincipal principal)
Deprecated. please use deletePrincipal(String principalID) |
void |
deletePrincipal(java.lang.String principalID)
This method deletes all data (owner, ACE) concerning a principal |
IAcl |
getAcl(java.lang.String objectId)
This method reads the existing ACL object for a portal object. |
IAcl[] |
getAcls(java.lang.String[] objectIds)
This method reads the existing ACL object for an array of object Ids. |
java.util.List |
getAllAcls()
This method returns a List of all available ACL ids (String objects) |
java.util.List |
getAllPermissions()
Gets a list of all available permissions |
int |
getMaxObjectIdLength()
This method returns the maximum length of the object id. |
int |
getMaxPermissionNameLength()
This method returns the maximum length of the permission name. |
java.util.List |
getPermissionMembers(java.lang.String permission)
Returns the permission members from the given permission. |
java.util.List |
getPermissions(java.lang.String objectType)
Gets a list of permissions which are available for the specific object type |
PermissionStatus |
getPermissionStatus(java.lang.String objectId,
IPrincipal principal,
java.lang.String permission)
This method returns the PermissionStatus for an action, a portal object and a user (principal). |
boolean |
hasPermission(java.lang.String objectId,
IPrincipal principal,
java.lang.String permission)
This method checks if a principal is authorized for a permission on an object, but doesn't write an entry in the security audit log. |
boolean |
isAllowed(java.lang.String[] objectIds,
IPrincipal principal,
java.lang.String permission)
This method checks if a principal is authorized for a number of permissions on an object. |
boolean |
isAllowed(java.lang.String objectId,
IPrincipal principal,
java.lang.String permission)
This method checks if a principal is authorized for a permission on an object. |
boolean |
removeAcl(IPrincipal caller,
IAcl acl)
This method removes the existing ACL object for a given acl. |
boolean |
removeAcl(IPrincipal caller,
java.lang.String objectId)
This method removes the existing ACL object for a given object Id. |
boolean |
removeAcls(IPrincipal caller,
java.lang.String[] objectIds)
This method removes the existing ACL object for a number of given object Ids. |
boolean |
removePermission(java.lang.String permission)
Removes a permission from the list of available permissions. |
boolean |
removePermissionMember(java.lang.String permission,
java.lang.String member)
Removes a permission member from the given permission. |
java.util.List |
searchAcls(java.lang.String principalID)
This method returns a List of ACL object ids (String objects), which fit the search criteria |
| Methods inherited from interface com.sap.security.api.IConfigurable |
initialize |
| Field Detail |
public static final int MAX_OBJECT_ID_LENGTH
public static final int MAX_PERMISSION_NAME_LENGTH
public static final java.lang.String OWNER_PERMISSION
| Method Detail |
public int getMaxObjectIdLength()
public int getMaxPermissionNameLength()
public IAcl createAcl(IPrincipal caller,
java.lang.String objectId)
throws UMException
caller - an IPrincial which will be registered as owner.objectId - a string which defines the object.UMException - if the ACL cannot be created.
public IAcl getAcl(java.lang.String objectId)
throws UMException
objectId - a string which defines the object.UMException - if the data cannot be read.
public IAcl[] getAcls(java.lang.String[] objectIds)
throws UMException
objectIds - a string array which defines the objects.UMException - if the data cannot be read.
public boolean removeAcl(IPrincipal caller,
java.lang.String objectId)
throws UMException
caller - a IPrincipal who has to be an owner of the acl.objectId - a string which defines the corresponding acl to remove.UMException - if the data cannot be removed.
public boolean removeAcl(IPrincipal caller,
IAcl acl)
throws UMException
caller - a IPrincipal who has to be an owner of the acl.acl - a acl which has to be removed.UMException - if the data cannot be removed.
public boolean removeAcls(IPrincipal caller,
java.lang.String[] objectIds)
throws UMException
caller - a IPrincipal who has to be an owner of the acls.objectIds - a string array which defines corresponding acls to remove.UMException - if the data cannot be removed.
public boolean isAllowed(java.lang.String objectId,
IPrincipal principal,
java.lang.String permission)
throws UMException
objectId - a string which defines the object.principal - user, group or role name.permission - checked action (permission).UMException - if the data cannot be read.
public boolean isAllowed(java.lang.String[] objectIds,
IPrincipal principal,
java.lang.String permission)
throws UMException
objectIds - a string array which defines the objects.principal - user, group or role name.permission - checked action (permission).UMException - if the data cannot be read.
public boolean hasPermission(java.lang.String objectId,
IPrincipal principal,
java.lang.String permission)
throws UMException
objectId - a string which defines the object.principal - user, group or rolepermission - checked action (permission).UMException - if the data cannot be read.
public boolean addPermission(java.lang.String permission,
java.util.List members)
throws UMException
permission - the permission to add (see class description)members - a list of permissions the added permission contains
or null if it contains no other permissionsUMException -
public boolean addPermissionMember(java.lang.String permission,
java.lang.String member)
throws UMException
permission - the permission for which the member should be addedmember - a permission that should be a member of the given
permissionUMException -
public boolean removePermission(java.lang.String permission)
throws UMException
permission - the permission to remove (see class description)UMException -
public boolean removePermissionMember(java.lang.String permission,
java.lang.String member)
throws UMException
permission - the parent permissionmember - the permission to removeUMException -
public java.util.List getPermissionMembers(java.lang.String permission)
throws UMException
permission - the parent permissionUMException -
public java.util.List getPermissions(java.lang.String objectType)
throws UMException
objectType - the object type
If it's an empty string, all global permissions are delivered.
UMException -
public java.util.List getAllPermissions()
throws UMException
UMException -
public PermissionStatus getPermissionStatus(java.lang.String objectId,
IPrincipal principal,
java.lang.String permission)
throws UMException
objectId - a string which define the object.principal - user, group or role name.permission - checked action (permission).UMException - if the data cannot be read.
public void deletePrincipal(IPrincipal principal)
throws UMException
principal - principal, whose related data should be deleted.UMException - if the data cannot be removed.
public void deletePrincipal(java.lang.String principalID)
throws UMException
principalID - uniqueID of principal, whose related data should be deleted.UMException - if the data cannot be removed.
public java.util.List getAllAcls()
throws UMException
UMException - if the data cannot be read.
public java.util.List searchAcls(java.lang.String principalID)
throws UMException
objectId - String of object id, for which a search should be
performed. The wildcard character "*" is permitted.
If a wildcard is set at begin or end of the object id,
a like search will be performed. If no wildcard is set,
a search for this exact id will be performed only.UMException - if the data cannot be read.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||