com.sapportals.wcm.util.acl

Class AclPrinter

java.lang.Object
  extended by com.sapportals.wcm.util.acl.AclPrinter

public class AclPrinter
extends Object

This Util class pretty-prints ACLs or parts of ACLs. ACLs are returned as String in the following schema:
ACL[RID:/documents/Test, LOCKINGUSER:principal, ENTRIES:{<principal:permission, 1>, <principal:permission, 2>}, OWNERS:{principal, principal}]
The schema may be modified by combining the bit constants with the | operator.

E.g.


Field Summary
static int DEFAULT
          Using this parameter everything is set to default.
static int ENTRY_DETAILED
          Using this parameter the sort index of an Entry is printed in addition to the principal/permission pairs.
static int PRINCIPAL_UNIQUEID
          Using this parameter the UniqueID of principals is printed instead of the Displayname (default)
static int PRINT_LOCKING_USER
          Using this parameter a potential locking user of the ACL is printed in addition to the Entries and Owners.
static int PRINT_RESOURCE_RID
          Using this parameter the Path of the Resource corresponding to the ACL is printed in addition to the Entries and Owners.
 
Constructor Summary
AclPrinter()
           
 
Method Summary
 IResourceAcl getAcl(IResource resource)
          Returns the (direct) ACL of a resource or null if no ACL is assigned for this resource.
 String printAcl(IResourceAcl acl, int parameterBits)
          Returns a String representing the specified ACL in the following schema:
ACL[RID:/documents/Test, LOCKINGUSER:principal, ENTRIES:{<principal:permission, 1>, <principal:permission, 2>}, OWNERS:{principal, principal}]
The schema can be modified via the bit constants ENTRY_DETAILED, PRINCIPAL_UNIQUEID, PRINT_LOCKING_USER and PRINT_RESOURCE_RID.
 String printAclEntries(IResourceAclEntryList entries, int parameterBits)
          Returns a String representing the list of ACL Entries in the following schema:
ENTRIES:{<principal:permission, 1>, <principal:permission, 2>}
The schema can be modified via the bit constants ENTRY_DETAILED and PRINCIPAL_UNIQUEID.
 String printAclOwners(List owners, int parameterBits)
          Returns a String representing the list of ACL Owners in the following schema:
OWNERS:{principal, principal}
The schema can be modified via the bit constant PRINCIPAL_UNIQUEID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final int DEFAULT
Using this parameter everything is set to default.

See Also:
Constant Field Values

PRINCIPAL_UNIQUEID

public static final int PRINCIPAL_UNIQUEID
Using this parameter the UniqueID of principals is printed instead of the Displayname (default)

See Also:
Constant Field Values

ENTRY_DETAILED

public static final int ENTRY_DETAILED
Using this parameter the sort index of an Entry is printed in addition to the principal/permission pairs.
default: <principal:permission>
with this parameter: <principal:permission, 1>

See Also:
Constant Field Values

PRINT_LOCKING_USER

public static final int PRINT_LOCKING_USER
Using this parameter a potential locking user of the ACL is printed in addition to the Entries and Owners.
default: ACL[ENTRIES:{...}, OWNERS:{...}]
with this parameter: ACL[LOCKINGUSER:principal, ENTRIES:{...}, OWNERS:{...}]

See Also:
Constant Field Values

PRINT_RESOURCE_RID

public static final int PRINT_RESOURCE_RID
Using this parameter the Path of the Resource corresponding to the ACL is printed in addition to the Entries and Owners.
default: ACL[ENTRIES:{...}, OWNERS:{...}]
with this parameter: ACL[RID:/documents/Test, ENTRIES:{...}, OWNERS:{...}]

See Also:
Constant Field Values
Constructor Detail

AclPrinter

public AclPrinter()
Method Detail

getAcl

public IResourceAcl getAcl(IResource resource)
                    throws ResourceException,
                           AclPersistenceException
Returns the (direct) ACL of a resource or null if no ACL is assigned for this resource. If the repository has no SecurityManager assigned or the SecurityManager is no AclSecurityManager null is returned.

Parameters:
resource -
Returns:
ACL or null if no ACL assigned
Throws:
ResourceException
AclPersistenceException

printAcl

public String printAcl(IResourceAcl acl,
                       int parameterBits)
                throws AclException
Returns a String representing the specified ACL in the following schema:
ACL[RID:/documents/Test, LOCKINGUSER:principal, ENTRIES:{<principal:permission, 1>, <principal:permission, 2>}, OWNERS:{principal, principal}]
The schema can be modified via the bit constants ENTRY_DETAILED, PRINCIPAL_UNIQUEID, PRINT_LOCKING_USER and PRINT_RESOURCE_RID.
You have to combine the constants using the | operator.
E.g. printAcl(acl, AclPrinter.DEFAULT) or printAcl(acl, AclPrinter.ENTRY_DETAILED|AclPrinter.PRINCIPAL_UNIQUEID)

Parameters:
acl - The ACL
parameterBits - Parameter constant bits combined with | operator. E.g. (PRINT_RESOURCE_RID|PRINCIPAL_UNIQUEID|ENTRY_DETAILED)
Returns:
String representing the ACL
Throws:
AclException

printAclEntries

public String printAclEntries(IResourceAclEntryList entries,
                              int parameterBits)
                       throws AclException
Returns a String representing the list of ACL Entries in the following schema:
ENTRIES:{<principal:permission, 1>, <principal:permission, 2>}
The schema can be modified via the bit constants ENTRY_DETAILED and PRINCIPAL_UNIQUEID.
You have to combine the constants using the | operator.
E.g. printAclEntries(entries, AclPrinter.DEFAULT) or printAclEntries(entries, AclPrinter.ENTRY_DETAILED|AclPrinter.PRINCIPAL_UNIQUEID)

Parameters:
entries - List of ACL Entries
parameterBits - Parameter constant bits combined with | operator. E.g. (PRINCIPAL_UNIQUEID|ENTRY_DETAILED)
Returns:
String representing the Entries of an ACL
Throws:
AclException

printAclOwners

public String printAclOwners(List owners,
                             int parameterBits)
                      throws AclException
Returns a String representing the list of ACL Owners in the following schema:
OWNERS:{principal, principal}
The schema can be modified via the bit constant PRINCIPAL_UNIQUEID.
E.g. printAclOwners(entries, AclPrinter.DEFAULT) or printAclOwners(entries, AclPrinter.PRINCIPAL_UNIQUEID)

Parameters:
owners - List of ACL Owners
parameterBits - Parameter constant bits combined with | operator. E.g. (PRINT_RESOURCE_RID|PRINCIPAL_UNIQUEID|ENTRY_DETAILED)
Returns:
String representing the Entries of an ACL
Throws:
AclException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice