org.apache.turbine.util.security
Interface AccessControlList

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
TurbineAccessControlList

public interface AccessControlList
extends java.io.Serializable

This interface describes a control class that makes it easy to find out if a particular User has a given Permission. It also determines if a User has a a particular Role.

Version:
$Id: AccessControlList.java 534527 2007-05-02 16:10:59Z tv $
Author:
John D. McNally, Brett McLaughlin, Greg Ritter, Rafal Krzewski, Marco Knüttel, Henning P. Schmiedehausen

Field Summary
static java.lang.String SESSION_KEY
          The default Session key for the Access Control List
 
Method Summary
 Group[] getAllGroups()
          Returns all groups definded in the system.
 PermissionSet getPermissions()
          Retrieves a set of Permissions an user is assigned in the global Group.
 PermissionSet getPermissions(Group group)
          Retrieves a set of Permissions an user is assigned in a Group.
 RoleSet getRoles()
          Retrieves a set of Roles an user is assigned in the global Group.
 RoleSet getRoles(Group group)
          Retrieves a set of Roles an user is assigned in a Group.
 boolean hasPermission(Permission permission)
          Checks if the user is assigned a specific Permission in the global Group.
 boolean hasPermission(Permission permission, Group group)
          Checks if the user is assigned a specific Permission in the Group.
 boolean hasPermission(Permission permission, GroupSet groupset)
          Checks if the user is assigned a specific Permission in any of the given Groups
 boolean hasPermission(java.lang.String permission)
          Checks if the user is assigned a specific Permission in the global Group.
 boolean hasPermission(java.lang.String permission, Group group)
          Checks if the user is assigned a specific Permission in the Group.
 boolean hasPermission(java.lang.String permissionName, GroupSet groupset)
          Checks if the user is assigned a specifie Permission in any of the given Groups
 boolean hasPermission(java.lang.String permission, java.lang.String group)
          Checks if the user is assigned a specific Permission in the Group.
 boolean hasRole(Role role)
          Checks if the user is assigned a specific Role in the global Group.
 boolean hasRole(Role role, Group group)
          Checks if the user is assigned a specific Role in the Group.
 boolean hasRole(Role role, GroupSet groupset)
          Checks if the user is assigned a specific Role in any of the given Groups
 boolean hasRole(java.lang.String role)
          Checks if the user is assigned a specific Role in the global Group.
 boolean hasRole(java.lang.String rolename, GroupSet groupset)
          Checks if the user is assigned a specifie Role in any of the given Groups
 boolean hasRole(java.lang.String role, java.lang.String group)
          Checks if the user is assigned a specific Role in the Group.
 

Field Detail

SESSION_KEY

public static final java.lang.String SESSION_KEY
The default Session key for the Access Control List

See Also:
Constant Field Values
Method Detail

getRoles

public RoleSet getRoles(Group group)
Retrieves a set of Roles an user is assigned in a Group.

Parameters:
group - the Group
Returns:
the set of Roles this user has within the Group.

getRoles

public RoleSet getRoles()
Retrieves a set of Roles an user is assigned in the global Group.

Returns:
the set of Roles this user has within the global Group.

getPermissions

public PermissionSet getPermissions(Group group)
Retrieves a set of Permissions an user is assigned in a Group.

Parameters:
group - the Group
Returns:
the set of Permissions this user has within the Group.

getPermissions

public PermissionSet getPermissions()
Retrieves a set of Permissions an user is assigned in the global Group.

Returns:
the set of Permissions this user has within the global Group.

hasRole

public boolean hasRole(Role role,
                       Group group)
Checks if the user is assigned a specific Role in the Group.

Parameters:
role - the Role
group - the Group
Returns:
true if the user is assigned the Role in the Group.

hasRole

public boolean hasRole(Role role,
                       GroupSet groupset)
Checks if the user is assigned a specific Role in any of the given Groups

Parameters:
role - the Role
groupset - a Groupset
Returns:
true if the user is assigned the Role in any of the given Groups.

hasRole

public boolean hasRole(java.lang.String role,
                       java.lang.String group)
Checks if the user is assigned a specific Role in the Group.

Parameters:
role - the Role
group - the Group
Returns:
true if the user is assigned the Role in the Group.

hasRole

public boolean hasRole(java.lang.String rolename,
                       GroupSet groupset)
Checks if the user is assigned a specifie Role in any of the given Groups

Parameters:
rolename - the name of the Role
groupset - a Groupset
Returns:
true if the user is assigned the Role in any of the given Groups.

hasRole

public boolean hasRole(Role role)
Checks if the user is assigned a specific Role in the global Group.

Parameters:
role - the Role
Returns:
true if the user is assigned the Role in the global Group.

hasRole

public boolean hasRole(java.lang.String role)
Checks if the user is assigned a specific Role in the global Group.

Parameters:
role - the Role
Returns:
true if the user is assigned the Role in the global Group.

hasPermission

public boolean hasPermission(Permission permission,
                             Group group)
Checks if the user is assigned a specific Permission in the Group.

Parameters:
permission - the Permission
group - the Group
Returns:
true if the user is assigned the Permission in the Group.

hasPermission

public boolean hasPermission(Permission permission,
                             GroupSet groupset)
Checks if the user is assigned a specific Permission in any of the given Groups

Parameters:
permission - the Permission
groupset - a Groupset
Returns:
true if the user is assigned the Permission in any of the given Groups.

hasPermission

public boolean hasPermission(java.lang.String permission,
                             java.lang.String group)
Checks if the user is assigned a specific Permission in the Group.

Parameters:
permission - the Permission
group - the Group
Returns:
true if the user is assigned the Permission in the Group.

hasPermission

public boolean hasPermission(java.lang.String permission,
                             Group group)
Checks if the user is assigned a specific Permission in the Group.

Parameters:
permission - the Permission
group - the Group
Returns:
true if the user is assigned the Permission in the Group.

hasPermission

public boolean hasPermission(java.lang.String permissionName,
                             GroupSet groupset)
Checks if the user is assigned a specifie Permission in any of the given Groups

Parameters:
permissionName - the name of the Permission
groupset - a Groupset
Returns:
true if the user is assigned the Permission in any of the given Groups.

hasPermission

public boolean hasPermission(Permission permission)
Checks if the user is assigned a specific Permission in the global Group.

Parameters:
permission - the Permission
Returns:
true if the user is assigned the Permission in the global Group.

hasPermission

public boolean hasPermission(java.lang.String permission)
Checks if the user is assigned a specific Permission in the global Group.

Parameters:
permission - the Permission
Returns:
true if the user is assigned the Permission in the global Group.

getAllGroups

public Group[] getAllGroups()
Returns all groups definded in the system.

Returns:
An Array of all defined Groups This is useful for debugging, when you want to display all roles and permissions an user is assigned. This method is needed because you can't call static methods of TurbineSecurity class from within WebMacro/Velocity template


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.