com.ibm.portal.ac
Interface AccessControlRuntimeModel


public interface AccessControlRuntimeModel

The AccessControlRuntimeModel provides read access to the current access control permissions on one resource. Use this interface to evaluate if the current user or any other user has been granted the access level represented by a specific RoleType

Since:
6.1.0.3

Method Summary
 boolean hasPermission(Principal principal, RoleType accessLevel)
          This method calculates if the given principal has been granted at least the privileges represented by the given RoleType.
 boolean hasPermission(RoleType accessLevel)
          This method calculates if the current user has been granted at least the privileges represented by the given RoleType.
 boolean isOwner()
          This method returns true if the current user is the owner of the resource.
 boolean isPrivate()
          This method returns true if the resource is a private resource.
 

Method Detail

hasPermission

boolean hasPermission(RoleType accessLevel)
                      throws AccessControlException,
                             SystemException
This method calculates if the current user has been granted at least the privileges represented by the given RoleType. Both privileges granted directly and on any of the groups that it belongs to are considered. Both explicit privileges on the resource and any of its parents in the resource model are considered (unless blocked by propagation or inheritance blocks).

Parameters:
accessLevel - the RoleType to the checked
Returns:
true if the current user has been granted at least the privileges represented by the given RoleType.
Throws:
AccessControlException - will be thrown if any access control related error occurs
SystemException - will be thrown if a system resource problem, e.g. a database exception, occurs

hasPermission

boolean hasPermission(Principal principal,
                      RoleType accessLevel)
                      throws AccessControlException,
                             SystemException
This method calculates if the given principal has been granted at least the privileges represented by the given RoleType. Both privileges granted directly and on any of the groups that it belongs to are considered. Both explicit privileges on the resource and any of its parents in the resource model are considered (unless blocked by propagation or inheritance blocks).

Parameters:
principal - to check the permissions for
accessLevel - the RoleType to the checked
Returns:
true if the current user has been granted at least the privileges represented by the given RoleType.
Throws:
AccessControlException - will be thrown if any access control related error occurs
SystemException - will be thrown if a system resource problem, e.g. a database exception, occurs

isOwner

boolean isOwner()
                throws AccessControlException,
                       SystemException
This method returns true if the current user is the owner of the resource. It returns false if the resource has no owner or someone else, including a group of the current user, owns the resource.

Returns:
true if the resource is owned by the current user.
Throws:
AccessControlException - will be thrown if any access control related error occurs
SystemException - will be thrown if a system resource problem, e.g. a database exception, occurs

isPrivate

boolean isPrivate()
                  throws AccessControlException,
                         SystemException
This method returns true if the resource is a private resource. It returns false if it is a public resource.

Returns:
true if the resource is a private resource.
Throws:
AccessControlException - will be thrown if any access control related error occurs
SystemException - will be thrown if a system resource problem, e.g. a database exception, occurs