|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jguard.ext.authorization.manager.AbstractAuthorizationManager
public abstract class AbstractAuthorizationManager
Abstract class inherited by all the AuthorizationManager implementations.
| Field Summary | |
|---|---|
protected java.security.Permissions |
alwaysGrantedPermissions
|
protected java.lang.String |
applicationName
|
protected java.util.Map |
domains
|
protected java.util.Map |
domainsPermissions
|
protected static java.util.Set |
domainsSet
|
protected java.util.Map |
hierarchyMap
|
protected java.util.Map |
options
|
protected java.util.Map |
permissions
|
protected java.util.Set |
permissionsSet
|
protected java.util.Map |
principals
|
protected java.util.Set |
principalsSet
|
protected net.sf.jguard.core.authorization.permissions.JGPermissionCollection |
urlp
|
| Constructor Summary | |
|---|---|
AbstractAuthorizationManager(java.util.Map options)
initialize AuthorizationManager implementation. |
|
| Method Summary | |
|---|---|
void |
addAlwaysGrantedPermissions(java.security.Permissions permissions)
add some permissions always granted by this Policy, like permission used to logoff in webapp, or permissions used to reached the AccessDenied page. |
void |
addInheritance(java.lang.String principalAscName,
java.lang.String principalDescName)
This commands establishes a new immediate inheritance relationship between the existing principals/principals roleAsc and the roleDesc. |
void |
addToPrincipal(java.lang.String roleName,
net.sf.jguard.core.authorization.permissions.Domain domain)
add the domain to the role, and persist the domain if it does not exists? |
void |
addToPrincipal(java.lang.String roleName,
java.security.Permission perm)
add the permission to the corresponding role. |
protected void |
assemblyHierarchy()
assembly the hierarchy of jGuardPrincipals. |
java.security.Principal |
clonePrincipal(java.lang.String roleName)
clone a RolePrincipal/Role and set its name with the name of the Principal to clone plus a random number. |
java.security.Principal |
clonePrincipal(java.lang.String roleName,
java.lang.String cloneName)
clone a RolePrincipal/Role. |
void |
deleteInheritance(java.lang.String roleAscName,
java.lang.String roleDescName)
|
protected void |
deleteReferenceInHierarchy(net.sf.jguard.core.principals.RolePrincipal principal)
|
java.lang.String |
getApplicationName()
|
protected net.sf.jguard.core.authorization.permissions.Domain |
getDomain(java.security.Permission permission)
return the domain which contains the permission. |
java.util.Map |
getDomains()
|
java.util.Set |
getDomains(java.util.Collection domainNames)
with a collection of domain names, provide the corresponding set of URLDomains. |
java.util.Map |
getDomainsPermissions()
|
java.util.Set |
getDomainsSet()
|
java.util.Map |
getHierarchyMap()
|
protected static java.lang.String |
getLocalName(java.security.Principal principal)
|
java.util.Map |
getOptions()
return an unmodifiable Map of options. |
java.util.Map |
getPermissions()
|
java.util.Set |
getPermissions(java.util.Collection permissionNames)
with a collection of URLPermissions names, provide the corresponding set of URLPermissions. |
java.security.PermissionCollection |
getPermissions(java.security.ProtectionDomain protectionDomain)
compare declared Principals in the application, with principals set of the user. |
java.util.Set |
getPermissionsSet()
|
java.util.Map |
getPrincipals()
|
java.util.Set |
getPrincipalsSet()
|
void |
importAuthorizationManager(net.sf.jguard.core.authorization.manager.AuthorizationManager authManager)
import data from the provided AbstractAuthorizationManager into our AuthorizationManager. |
java.util.Set |
listDomains()
return Set of domains. |
net.sf.jguard.core.authorization.permissions.JGPermissionCollection |
listPermissions()
return all the permissions. |
java.util.Set |
listPrincipals()
return the principal's Set. |
net.sf.jguard.core.authorization.permissions.JGPermissionCollection |
readDomain(java.lang.String domainName)
return an Domain with its associated URLPermission set. |
java.security.Permission |
readPermission(java.lang.String permissionName)
read an URLPermission. |
java.security.Principal |
readPrincipal(java.lang.String roleName)
return the corresponding application role. |
abstract void |
refresh()
|
protected void |
removeDomainFromPrincipals(java.lang.String domainName)
Remove the domain from all principals that have relationship with this domain. |
protected void |
removePermissionFromPrincipals(java.lang.String permissionName)
Remove the permission from all principals that have relationship with this permission like a orphaned permission (directly), or through a domain (indirectly). |
void |
setApplicationName(java.lang.String applicationName)
define the application's name, and propagate it into Principals. |
void |
updatePrincipal(java.security.Principal principal)
replace the inital principal with the new one. |
protected void |
updatePrincipals(net.sf.jguard.core.authorization.permissions.Domain domain)
Update the permissions from jGuardPrincipals that contains this domain. |
protected void |
updatePrincipals(net.sf.jguard.core.authorization.permissions.JGPermissionCollection newDomain,
java.lang.String oldDomainName)
update the principals with this updated domain. |
protected void |
updatePrincipals(java.security.Permission permission)
Update the permissions from jGuardPrincipals and the associated domain. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.jguard.core.authorization.manager.AuthorizationManager |
|---|
createDomain, createPermission, createPrincipal, deleteDomain, deletePermission, deletePrincipal, getInitParameters, isEmpty, updateDomain, updatePermission, updatePrincipal |
| Field Detail |
|---|
protected java.lang.String applicationName
protected java.util.Map principals
protected java.util.Set principalsSet
protected java.util.Map domains
protected static java.util.Set domainsSet
protected net.sf.jguard.core.authorization.permissions.JGPermissionCollection urlp
protected java.util.Map permissions
protected java.util.Set permissionsSet
protected java.util.Map domainsPermissions
protected java.util.Map hierarchyMap
protected java.util.Map options
protected java.security.Permissions alwaysGrantedPermissions
| Constructor Detail |
|---|
public AbstractAuthorizationManager(java.util.Map options)
options - | Method Detail |
|---|
public void setApplicationName(java.lang.String applicationName)
applicationName - public java.util.Set getDomains(java.util.Collection domainNames)
getDomains in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerdomainNames - collection of domains.
public java.util.Set getPermissions(java.util.Collection permissionNames)
getPermissions in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerpermissionNames - collection of permission names to grab.
public abstract void refresh()
refresh in interface net.sf.jguard.core.authorization.manager.PermissionProvidernet.sf.jguard.ext.authorization.manager.AuthorizationManager#refresh()public java.security.PermissionCollection getPermissions(java.security.ProtectionDomain protectionDomain)
getPermissions in interface net.sf.jguard.core.authorization.manager.PermissionProviderprincipals -
net.sf.jguard.ext.authorization.manager.AuthorizationManager#getPermissionCollection(java.util.Set),
PermissionProvider
public java.security.Principal clonePrincipal(java.lang.String roleName)
throws net.sf.jguard.core.authorization.AuthorizationException
clonePrincipal in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerroleName - RolePrincipal name to clone
net.sf.jguard.core.authorization.AuthorizationException
public java.security.Principal clonePrincipal(java.lang.String roleName,
java.lang.String cloneName)
throws net.sf.jguard.core.authorization.AuthorizationException
clonePrincipal in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerroleName - RolePrincipal name to clonecloneName - RolePrincipal cloned name
net.sf.jguard.core.authorization.AuthorizationException
public java.util.Set listDomains()
throws net.sf.jguard.core.authorization.AuthorizationException
listDomains in interface net.sf.jguard.core.authorization.manager.AuthorizationManagernet.sf.jguard.core.authorization.AuthorizationExceptionnet.sf.jguard.ext.authorization.manager.AuthorizationManager#listDomains()
public java.security.Permission readPermission(java.lang.String permissionName)
throws net.sf.jguard.core.authorization.AuthorizationException
readPermission in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerpermissionName -
net.sf.jguard.core.authorization.AuthorizationExceptionnet.sf.jguard.ext.authorization.manager.AuthorizationManager#readPermission(java.lang.String)
public net.sf.jguard.core.authorization.permissions.JGPermissionCollection readDomain(java.lang.String domainName)
throws net.sf.jguard.core.authorization.AuthorizationException
readDomain in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerdomainName -
net.sf.jguard.core.authorization.AuthorizationExceptionnet.sf.jguard.ext.authorization.manager.AuthorizationManager#readDomain(java.lang.String)
public java.security.Principal readPrincipal(java.lang.String roleName)
throws net.sf.jguard.core.authorization.AuthorizationException
readPrincipal in interface net.sf.jguard.core.authorization.manager.AuthorizationManagernet.sf.jguard.core.authorization.AuthorizationExceptionnet.sf.jguard.ext.authorization.manager.AuthorizationManager#readPrincipal(java.lang.String)protected void updatePrincipals(net.sf.jguard.core.authorization.permissions.Domain domain)
Update the permissions from jGuardPrincipals that contains this domain.
Note: This method is need because, first, there are no warranty that the reference of domain in the RolePrincipal object are the same from domainsSet and map and, second, the getPermissions method from RolePrincipal don't load the permissions from domains objects (it use a internal set of permissions).
domain - the domain that will be updated in the principalsprotected void updatePrincipals(java.security.Permission permission)
Update the permissions from jGuardPrincipals and the associated domain.
Note: This method is need because, first, there are no warranty that the reference of domain in the RolePrincipal object are the same from domainsSet and map and, second, the getPermissions method from RolePrincipal don't load the permissions from domains objects (it use a internal set of permissions).
permission - whose domain will be updated in the principals
protected void updatePrincipals(net.sf.jguard.core.authorization.permissions.JGPermissionCollection newDomain,
java.lang.String oldDomainName)
newDomain - oldDomainName - protected void removeDomainFromPrincipals(java.lang.String domainName)
domainName - the name of the domain that will be removedprotected void removePermissionFromPrincipals(java.lang.String permissionName)
permissionName - the name of the permission that will be removedprotected net.sf.jguard.core.authorization.permissions.Domain getDomain(java.security.Permission permission)
permission -
public void addToPrincipal(java.lang.String roleName,
java.security.Permission perm)
throws net.sf.jguard.core.authorization.AuthorizationException
addToPrincipal in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerroleName - role updatedperm - permission to add
net.sf.jguard.core.authorization.AuthorizationException
public void addToPrincipal(java.lang.String roleName,
net.sf.jguard.core.authorization.permissions.Domain domain)
throws net.sf.jguard.core.authorization.AuthorizationException
addToPrincipal in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerroleName - domain -
net.sf.jguard.core.authorization.AuthorizationException
public void addInheritance(java.lang.String principalAscName,
java.lang.String principalDescName)
throws net.sf.jguard.core.authorization.AuthorizationException
addInheritance in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerprincipalAscName - the principal/role local name that will inherite.principalDescName - the principal/role local name that will be inherited.
net.sf.jguard.core.authorization.AuthorizationException - if the inheritance already exists or create a cycle.
public void deleteInheritance(java.lang.String roleAscName,
java.lang.String roleDescName)
throws net.sf.jguard.core.authorization.AuthorizationException
deleteInheritance in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerroleAscName - the role that inherit.roleDescName - the role that is inherited.
net.sf.jguard.core.authorization.AuthorizationException - if the inheritance already exists or create a cycle.
public void updatePrincipal(java.security.Principal principal)
throws net.sf.jguard.core.authorization.AuthorizationException
updatePrincipal in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerprincipal - RolePrincipal updated
net.sf.jguard.core.authorization.AuthorizationExceptionnet.sf.jguard.ext.authorization.manager.AuthorizationManager#updatePrincipal(net.sf.jguard.core.principals.RolePrincipal)protected void assemblyHierarchy()
protected void deleteReferenceInHierarchy(net.sf.jguard.core.principals.RolePrincipal principal)
principal - public java.util.Set listPrincipals()
listPrincipals in interface net.sf.jguard.core.authorization.manager.AuthorizationManagernet.sf.jguard.ext.authorization.manager.AuthorizationManager#listPrincipals()public net.sf.jguard.core.authorization.permissions.JGPermissionCollection listPermissions()
listPermissions in interface net.sf.jguard.core.authorization.manager.AuthorizationManagernet.sf.jguard.ext.authorization.manager.AuthorizationManager#listPermissions()
public void importAuthorizationManager(net.sf.jguard.core.authorization.manager.AuthorizationManager authManager)
throws net.sf.jguard.core.authorization.AuthorizationException
importAuthorizationManager in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerauthManager -
net.sf.jguard.core.authorization.AuthorizationExceptionpublic final java.util.Set getDomainsSet()
getDomainsSet in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerpublic final java.util.Map getDomains()
public final java.util.Map getDomainsPermissions()
public final java.util.Map getHierarchyMap()
public final java.util.Map getPermissions()
public final java.util.Set getPermissionsSet()
getPermissionsSet in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerpublic final java.util.Map getPrincipals()
public final java.util.Set getPrincipalsSet()
getPrincipalsSet in interface net.sf.jguard.core.authorization.manager.AuthorizationManagerprotected static java.lang.String getLocalName(java.security.Principal principal)
public final void addAlwaysGrantedPermissions(java.security.Permissions permissions)
addAlwaysGrantedPermissions in interface net.sf.jguard.core.authorization.manager.PermissionProviderpermissions - permissions always granted by this Policypublic final java.util.Map getOptions()
public java.lang.String getApplicationName()
getApplicationName in interface net.sf.jguard.core.authorization.manager.AuthorizationManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||