|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IAclManager
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 example 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 about 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);
NOTE: deletePrincipal(java.lang.String)
is the only method which implicitly triggers cluster-wide cache invalidation. Therefore all changes done
via other methods of IAclManager need to be followed by IAcl.commit() on the affected IAcl objects
to get the changes also reflected on other cluster nodes.
| Field Summary | |
|---|---|
static int |
MAX_OBJECT_ID_LENGTH
Max. length of object ID (incl. an optional service name / object type) |
static int |
MAX_PERMISSION_NAME_LENGTH
Max. length of permission name |
static String |
OWNER_PERMISSION
Permission that an owner of an ACL gets automatically |
| Method Summary | |
|---|---|
boolean |
addPermission(String permission,
List members)
Adds a permission to the list of available permissions. |
boolean |
addPermissionMember(String permission,
String member)
Adds a member (permission) to an existing permission. |
IAcl |
createAcl(IPrincipal caller,
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(String principalID)
This method deletes all data (owner, ACE) concerning a principal |
IAcl |
getAcl(String objectId)
This method reads the existing ACL object for a portal object. |
IAcl[] |
getAcls(String[] objectIds)
This method reads the existing ACL object for an array of object Ids. |
List |
getAllAcls()
This method returns a List of all available ACL ids (String objects) |
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. |
List |
getPermissionMembers(String permission)
Returns the permission members from the given permission. |
List |
getPermissions(String objectType)
Gets a list of permissions which are available for the specific object type |
PermissionStatus |
getPermissionStatus(String objectId,
IPrincipal principal,
String permission)
This method returns the PermissionStatus for an action, a portal object and a user (principal). |
boolean |
hasPermission(String objectId,
IPrincipal principal,
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(String[] objectIds,
IPrincipal principal,
String permission)
This method checks if a principal is authorized for a number of permissions on an object. |
boolean |
isAllowed(String objectId,
IPrincipal principal,
String permission)
This method checks if a principal is authorized for a permission on an object. |
void |
logAclInfo(String objectID,
String objectName,
String comment)
This method logs the passed information directly into the security audit log file. |
boolean |
removeAcl(IPrincipal caller,
IAcl acl)
This method removes the existing ACL object for a given acl. |
boolean |
removeAcl(IPrincipal caller,
String objectId)
This method removes the existing ACL object for a given object Id. |
boolean |
removeAcls(IPrincipal caller,
String[] objectIds)
This method removes the existing ACL object for a number of given object Ids. |
boolean |
removePermission(String permission)
Removes a permission from the list of available permissions. |
boolean |
removePermissionMember(String permission,
String member)
Removes a permission member from the given permission. |
List |
searchAcls(String principalID)
This method returns a List of ACL object ids (String objects), which fit the search criteria |
void |
setAclServiceUser(String serviceUserId)
This methods sets the service user for the current ACL manager. |
| Methods inherited from interface com.sap.security.api.IConfigurable |
|---|
initialize |
| Field Detail |
|---|
static final int MAX_OBJECT_ID_LENGTH
static final int MAX_PERMISSION_NAME_LENGTH
static final String OWNER_PERMISSION
| Method Detail |
|---|
int getMaxObjectIdLength()
int getMaxPermissionNameLength()
void setAclServiceUser(String serviceUserId)
throws UMException
serviceUserId - The uniqueID of the service user.
UMException - if the ACL service user can't be set.
IAcl createAcl(IPrincipal caller,
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.
IAcl getAcl(String objectId)
throws UMException
objectId - a string which defines the object.
UMException - if the data cannot be read.
IAcl[] getAcls(String[] objectIds)
throws UMException
objectIds - a string array which defines the objects.
UMException - if the data cannot be read.
boolean removeAcl(IPrincipal caller,
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.
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.
boolean removeAcls(IPrincipal caller,
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.
boolean isAllowed(String objectId,
IPrincipal principal,
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.
boolean isAllowed(String[] objectIds,
IPrincipal principal,
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.
boolean hasPermission(String objectId,
IPrincipal principal,
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.
boolean addPermission(String permission,
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 permissions
UMException
boolean addPermissionMember(String permission,
String member)
throws UMException
permission - the permission for which the member should be addedmember - a permission that should be a member of the given
permission
UMException
boolean removePermission(String permission)
throws UMException
permission - the permission to remove (see class description)
UMException
boolean removePermissionMember(String permission,
String member)
throws UMException
permission - the parent permissionmember - the permission to remove
UMException
List getPermissionMembers(String permission)
throws UMException
permission - the parent permission
UMException
List getPermissions(String objectType)
throws UMException
objectType - the object type
If it's an empty string, all global permissions are delivered.
UMException
List getAllPermissions()
throws UMException
UMException
PermissionStatus getPermissionStatus(String objectId,
IPrincipal principal,
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.
void deletePrincipal(IPrincipal principal)
throws UMException
principal - principal, whose related data should be deleted.
UMException - if the data cannot be removed.
void deletePrincipal(String principalID)
throws UMException
principalID - uniqueID of principal, whose related data should be deleted.
UMException - if the data cannot be removed.
List getAllAcls()
throws UMException
UMException - if the data cannot be read.
List searchAcls(String principalID)
throws UMException
principalID - 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.
void logAclInfo(String objectID,
String objectName,
String comment)
objectID - a string which defines the object.objectName - complete readable object namecomment - should contain information about the cause of (a group of)
following ACL modifications| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] ENGINEAPI
|
[sap.com] com.sap.security.api.sda
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/usermanagement/api
|
[sap.com] CORE-TOOLS
|
[sap.com] com.sap.engine.client.lib
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||