deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.security.drm
Class SecurityAccess

java.lang.Object
  extended by org.deegree.security.drm.SecurityAccess
Direct Known Subclasses:
SecurityTransaction

public class SecurityAccess
extends java.lang.Object

Since:
2.0
Version:
$Revision: 25490 $, 1.0. $Revision: 25490 $, $Date: 2010-07-26 11:47:34 +0200 (Mo, 26 Jul 2010) $
Author:
Andreas Poth, last edited by: $Author: aschmitz $

Field Summary
protected  SecurityRegistry registry
           
protected  User user
           
 
Constructor Summary
SecurityAccess(User user, SecurityRegistry registry)
           
 
Method Summary
protected  void checkForPrivilege(Privilege privilege)
          Checks if the associated User has a certain Privilege.
protected  void checkForRight(RightType right, SecurableObject object)
          Checks if the associated User has a certain Right on the given SecurableObject.
 Group[] findGroupCycle()
          Tries to find a cyle in the groups relations of the Registry.
 Group[] getAllGroups()
           
 Role[] getAllRoles()
          Retrieves all Role s from the Registry, except those that are only used internally (these have a namespace starting with the $ symbol);
 Role[] getAllRolesForGroup(Group group)
          Returns all Role s that the given Group is associated with (directly and via group memberships).
 Role[] getAllRolesForUser(User user)
          Returns all Role s that the given User is associated with (directly and via group memberships).
 SecuredObject[] getAllSecuredObjects(java.lang.String type)
           
 java.util.LinkedList<Service> getAllServices()
           
 User[] getAllUsers()
           
 Group getGroupById(int id)
           
 Group getGroupByName(java.lang.String name)
           
 Privilege getPrivilegeByName(java.lang.String name)
           
 RightType getRightByName(java.lang.String name)
           
 Role getRoleById(int id)
           
 Role getRoleByName(java.lang.String name)
           
 Role[] getRolesByNS(java.lang.String ns)
           
 java.util.LinkedList<Service> getRolesServices(Role role)
           
 SecuredObject getSecuredObjectById(int id)
           
 SecuredObject getSecuredObjectByName(java.lang.String name, java.lang.String type)
           
 SecuredObject[] getSecuredObjectsByNS(java.lang.String ns, java.lang.String type)
           
 Service getServiceByAddress(java.lang.String address)
           
 User getUser()
           
 User getUserById(int id)
           
 User getUserByName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user

protected User user

registry

protected SecurityRegistry registry
Constructor Detail

SecurityAccess

SecurityAccess(User user,
               SecurityRegistry registry)
Method Detail

getUser

public User getUser()
Returns:
probably the admin user

getUserByName

public User getUserByName(java.lang.String name)
                   throws GeneralSecurityException
Parameters:
name -
Returns:
the user
Throws:
GeneralSecurityException

getUserById

public User getUserById(int id)
                 throws GeneralSecurityException
Parameters:
id -
Returns:
the user
Throws:
GeneralSecurityException

getGroupByName

public Group getGroupByName(java.lang.String name)
                     throws GeneralSecurityException
Parameters:
name -
Returns:
the group
Throws:
GeneralSecurityException

getGroupById

public Group getGroupById(int id)
                   throws GeneralSecurityException
Parameters:
id -
Returns:
the group
Throws:
GeneralSecurityException

getRoleByName

public Role getRoleByName(java.lang.String name)
                   throws GeneralSecurityException
Parameters:
name -
Returns:
the role
Throws:
GeneralSecurityException

getRolesByNS

public Role[] getRolesByNS(java.lang.String ns)
                    throws GeneralSecurityException
Parameters:
ns -
Returns:
the roles
Throws:
GeneralSecurityException

getRoleById

public Role getRoleById(int id)
                 throws GeneralSecurityException
Parameters:
id -
Returns:
the role
Throws:
GeneralSecurityException

getRightByName

public RightType getRightByName(java.lang.String name)
                         throws GeneralSecurityException
Parameters:
name -
Returns:
the right
Throws:
GeneralSecurityException

getPrivilegeByName

public Privilege getPrivilegeByName(java.lang.String name)
                             throws GeneralSecurityException
Parameters:
name -
Returns:
the privilege
Throws:
GeneralSecurityException

getSecuredObjectById

public SecuredObject getSecuredObjectById(int id)
                                   throws GeneralSecurityException
Parameters:
id -
Returns:
the object
Throws:
GeneralSecurityException

getSecuredObjectByName

public SecuredObject getSecuredObjectByName(java.lang.String name,
                                            java.lang.String type)
                                     throws GeneralSecurityException
Parameters:
name -
type -
Returns:
the object
Throws:
GeneralSecurityException

getSecuredObjectsByNS

public SecuredObject[] getSecuredObjectsByNS(java.lang.String ns,
                                             java.lang.String type)
                                      throws GeneralSecurityException
Parameters:
ns -
type -
Returns:
the objects
Throws:
GeneralSecurityException

getAllUsers

public User[] getAllUsers()
                   throws GeneralSecurityException
Returns:
the users
Throws:
GeneralSecurityException

getAllGroups

public Group[] getAllGroups()
                     throws GeneralSecurityException
Returns:
all groups
Throws:
GeneralSecurityException

getAllSecuredObjects

public SecuredObject[] getAllSecuredObjects(java.lang.String type)
                                     throws GeneralSecurityException
Parameters:
type -
Returns:
all secured objects
Throws:
GeneralSecurityException

getAllRoles

public Role[] getAllRoles()
                   throws GeneralSecurityException
Retrieves all Role s from the Registry, except those that are only used internally (these have a namespace starting with the $ symbol);

Returns:
all roles
Throws:
GeneralSecurityException

getAllRolesForUser

public Role[] getAllRolesForUser(User user)
                          throws GeneralSecurityException
Returns all Role s that the given User is associated with (directly and via group memberships).

Parameters:
user -
Returns:
all his roles
Throws:
GeneralSecurityException

getAllRolesForGroup

public Role[] getAllRolesForGroup(Group group)
                           throws GeneralSecurityException
Returns all Role s that the given Group is associated with (directly and via group memberships).

Parameters:
group -
Returns:
all their roles
Throws:
GeneralSecurityException

findGroupCycle

public Group[] findGroupCycle()
                       throws GeneralSecurityException
Tries to find a cyle in the groups relations of the Registry.

Returns:
indicates the cycle's nodes (groups)
Throws:
GeneralSecurityException

checkForPrivilege

protected void checkForPrivilege(Privilege privilege)
                          throws GeneralSecurityException
Checks if the associated User has a certain Privilege.

Parameters:
privilege -
Throws:
GeneralSecurityException - if holder does not have the privilege

checkForRight

protected void checkForRight(RightType right,
                             SecurableObject object)
                      throws UnauthorizedException,
                             GeneralSecurityException
Checks if the associated User has a certain Right on the given SecurableObject.

Parameters:
right -
object -
Throws:
GeneralSecurityException - this is a UnauthorizedException if the holder does not have the right
UnauthorizedException

getServiceByAddress

public Service getServiceByAddress(java.lang.String address)
                            throws GeneralSecurityException
Parameters:
address -
Returns:
the service
Throws:
GeneralSecurityException

getAllServices

public java.util.LinkedList<Service> getAllServices()
                                             throws GeneralSecurityException
Returns:
all services
Throws:
GeneralSecurityException

getRolesServices

public java.util.LinkedList<Service> getRolesServices(Role role)
                                               throws GeneralSecurityException
Parameters:
role -
Returns:
the appropriate services
Throws:
GeneralSecurityException

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org