|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.security.BaseSecurityService
org.apache.turbine.services.security.torque.TorqueSecurityService
public class TorqueSecurityService
An implementation of SecurityService that uses torque objects.
Field Summary |
---|
Fields inherited from class org.apache.turbine.services.BaseService |
---|
configuration, name, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
---|
initableBroker, isInitialized |
Fields inherited from interface org.apache.turbine.services.security.SecurityService |
---|
ACL_CLASS_DEFAULT, ACL_CLASS_KEY, GROUP_CLASS_DEFAULT, GROUP_CLASS_KEY, PERMISSION_CLASS_DEFAULT, PERMISSION_CLASS_KEY, ROLE_CLASS_DEFAULT, ROLE_CLASS_KEY, SECURE_PASSWORDS_ALGORITHM_DEFAULT, SECURE_PASSWORDS_ALGORITHM_KEY, SECURE_PASSWORDS_DEFAULT, SECURE_PASSWORDS_KEY, SERVICE_NAME, USER_CLASS_DEFAULT, USER_CLASS_KEY, USER_MANAGER_DEFAULT, USER_MANAGER_KEY |
Constructor Summary | |
---|---|
TorqueSecurityService()
|
Method Summary | |
---|---|
Group |
addGroup(Group group)
Creates a new group with specified attributes. |
Permission |
addPermission(Permission permission)
Creates a new permission with specified attributes. |
Role |
addRole(Role role)
Creates a new role with specified attributes. |
protected boolean |
checkExists(Group group)
Determines if the Group exists in the security system. |
protected boolean |
checkExists(Permission permission)
Determines if the Permission exists in the security system. |
protected boolean |
checkExists(Role role)
Determines if the Role exists in the security system. |
AccessControlList |
getACL(User user)
Constructs an AccessControlList for a specific user. |
GroupSet |
getAllGroups()
Retrieves all groups defined in the system. |
PermissionSet |
getAllPermissions()
Retrieves all permissions defined in the system. |
RoleSet |
getAllRoles()
Retrieves all roles defined in the system. |
GroupSet |
getGroups(Object criteria)
Retrieve a set of Groups that meet the specified Criteria. |
PermissionSet |
getPermissions(Object criteria)
Retrieve a set of Permissions that meet the specified Criteria. |
PermissionSet |
getPermissions(Role role)
Retrieves all permissions associated with a role. |
RoleSet |
getRoles(Object criteria)
Retrieve a set of Roles that meet the specified Criteria. |
List |
getUserList(Object criteria)
Retrieve a set of users that meet the specified criteria. |
void |
grant(Role role,
Permission permission)
Grants a Role a Permission |
void |
grant(User user,
Group group,
Role role)
Grant an User a Role in a Group. |
void |
init()
Initializes the TorqueSecurityService, loading the various class objects representing the security entity peer classes |
void |
removeGroup(Group group)
Removes a Group from the system. |
void |
removePermission(Permission permission)
Removes a Permission from the system. |
void |
removeRole(Role role)
Removes a Role from the system. |
void |
renameGroup(Group group,
String name)
Renames an existing Group. |
void |
renamePermission(Permission permission,
String name)
Renames an existing Permission. |
void |
renameRole(Role role,
String name)
Renames an existing Role. |
void |
revoke(Role role,
Permission permission)
Revokes a Permission from a Role. |
void |
revoke(User user,
Group group,
Role role)
Revoke a Role in a Group from an User. |
void |
revokeAll(Role role)
Revokes all permissions from a Role. |
void |
revokeAll(User user)
Revokes all roles from an User. |
void |
saveGroup(Group group)
Stores Group's attributes. |
void |
savePermission(Permission permission)
Stores Permission's attributes. |
void |
saveRole(Role role)
Stores Role's attributes. |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
---|
init, init, init, shutdown |
Methods inherited from class org.apache.turbine.services.BaseService |
---|
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
---|
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Service |
---|
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
---|
getInit, init, setInitableBroker, shutdown |
Constructor Detail |
---|
public TorqueSecurityService()
Method Detail |
---|
public void init() throws InitializationException
init
in interface Initable
init
in class BaseSecurityService
InitializationException
- A problem occured during initializationpublic AccessControlList getACL(User user) throws DataBackendException, UnknownEntityException
user
- the user for whom the AccessControlList are to be retrieved
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if user account is not present.public void grant(User user, Group group, Role role) throws DataBackendException, UnknownEntityException
user
- the user.group
- the group.role
- the role.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if user account, group or role is not
present.public void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException
user
- the user.group
- the group.role
- the role.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if user account, group or role is not
present.public void revokeAll(User user) throws DataBackendException, UnknownEntityException
user
- the User.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the account is not present.public void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException
role
- the Role.permission
- the Permission.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if role or permission is not present.public void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException
role
- the Role.permission
- the Permission.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if role or permission is not present.public void revokeAll(Role role) throws DataBackendException, UnknownEntityException
role
- the Role
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the Role is not present.public GroupSet getGroups(Object criteria) throws DataBackendException
criteria
- A Criteria of Group selection.
DataBackendException
- if there was an error accessing the data
backend.public RoleSet getRoles(Object criteria) throws DataBackendException
criteria
- A Criteria of Roles selection.
DataBackendException
- if there was an error accessing the data
backend.public PermissionSet getPermissions(Object criteria) throws DataBackendException
criteria
- A Criteria of Permissions selection.
DataBackendException
- if there was an error accessing the data
backend.public PermissionSet getPermissions(Role role) throws DataBackendException, UnknownEntityException
role
- the role name, for which the permissions are to be retrieved.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the role is not present.public void saveGroup(Group group) throws DataBackendException, UnknownEntityException
group
- The Group to be stored.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the group does not exist.public void saveRole(Role role) throws DataBackendException, UnknownEntityException
role
- The Role to be stored.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the role does not exist.public void savePermission(Permission permission) throws DataBackendException, UnknownEntityException
permission
- The Permission to be stored.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the permission does not exist.public Group addGroup(Group group) throws DataBackendException, EntityExistsException
group
- the object describing the group to be created.
DataBackendException
- if there was an error accessing the data
backend.
EntityExistsException
- if the group already exists.public Role addRole(Role role) throws DataBackendException, EntityExistsException
role
- the object describing the role to be created.
DataBackendException
- if there was an error accessing the data
backend.
EntityExistsException
- if the role already exists.public Permission addPermission(Permission permission) throws DataBackendException, EntityExistsException
permission
- the object describing the permission to be created.
DataBackendException
- if there was an error accessing the data
backend.
EntityExistsException
- if the permission already exists.public void removeGroup(Group group) throws DataBackendException, UnknownEntityException
group
- The object describing the group to be removed.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the group does not exist.public void removeRole(Role role) throws DataBackendException, UnknownEntityException
role
- The object describing the role to be removed.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the role does not exist.public void removePermission(Permission permission) throws DataBackendException, UnknownEntityException
permission
- The object describing the permission to be removed.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the permission does not exist.public void renameGroup(Group group, String name) throws DataBackendException, UnknownEntityException
group
- The object describing the group to be renamed.name
- the new name for the group.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the group does not exist.public void renameRole(Role role, String name) throws DataBackendException, UnknownEntityException
role
- The object describing the role to be renamed.name
- the new name for the role.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the role does not exist.public void renamePermission(Permission permission, String name) throws DataBackendException, UnknownEntityException
permission
- The object describing the permission to be renamed.name
- the new name for the permission.
DataBackendException
- if there was an error accessing the data
backend.
UnknownEntityException
- if the permission does not exist.protected boolean checkExists(Group group) throws DataBackendException, Exception
Group
exists in the security system.
group
- a Group
value
DataBackendException
- when more than one Group with
the same name exists.
Exception
- A generic exception.protected boolean checkExists(Role role) throws DataBackendException, Exception
Role
exists in the security system.
role
- a Role
value
DataBackendException
- when more than one Role with
the same name exists.
Exception
- A generic exception.protected boolean checkExists(Permission permission) throws DataBackendException, Exception
Permission
exists in the security system.
permission
- a Permission
value
DataBackendException
- when more than one Permission with
the same name exists.
Exception
- A generic exception.public GroupSet getAllGroups() throws DataBackendException
getAllGroups
in interface SecurityService
getAllGroups
in class BaseSecurityService
DataBackendException
- if there was an error accessing the
data backend.public PermissionSet getAllPermissions() throws DataBackendException
getAllPermissions
in interface SecurityService
getAllPermissions
in class BaseSecurityService
DataBackendException
- if there was an error accessing the
data backend.public RoleSet getAllRoles() throws DataBackendException
getAllRoles
in interface SecurityService
getAllRoles
in class BaseSecurityService
DataBackendException
- if there was an error accessing the
data backend.public List getUserList(Object criteria) throws DataBackendException
User
interface, plus the names
of the custom attributes you added to your user representation
in the data storage. Use verbatim names of the attributes -
without table name prefix in case of Torque implementation.
criteria
- The criteria of selection.
DataBackendException
- if there is a problem accessing the
storage.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |