|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.security.auth.Policy
org.systinet.security.policy.UpdateablePolicy
org.systinet.security.policy.Policy2UpdateablePolicy
This is a wrapper class for representing the updateable policy using JAAS policy. Extension methods (those that are not in standard Java Policy) always throw AccessControlException with the unsupported information message, unless the wrapped policy is not instance of UpdateablePolicy (then the behaviour is left to the nested one).
Field Summary |
Fields inherited from class org.systinet.security.policy.UpdateablePolicy |
WASP_POLICY_CHECKER, WASP_POLICY_IMPL |
Constructor Summary | |
Policy2UpdateablePolicy(java.util.Map initParams)
Wrapps JAAS Policy into an updatable policy. |
|
Policy2UpdateablePolicy(javax.security.auth.Policy policy)
Wrapps given policy into an updatable policy. |
Method Summary | |
boolean |
addPermission(java.security.CodeSource cs,
java.security.Principal principal,
java.security.Permission permission)
Adds a single permission to specified principal. |
void |
addPermissions(java.security.CodeSource cs,
java.security.Principal principal,
java.security.PermissionCollection collection)
Adds collection of permissions to specified principal. |
boolean |
addPermissionToRole(java.lang.String roleName,
java.security.Permission permission)
Adds permission to role. |
java.security.PermissionCollection |
getPermissions(javax.security.auth.Subject subject,
java.security.CodeSource codesource)
Retrieve the Permissions granted to the Principals associated with the specified CodeSource, always returns a collection containg AllPermissons . |
PrincipalEntries |
getPrincipalEntries()
Returns enumeration of all principal entries. |
PrincipalEntries |
getPrincipalEntries(java.security.Permission perm)
Returns enumeration of principal entries that are granted with specified atomic permission. |
java.security.PermissionCollection |
getPrincipalPermissions(java.security.CodeSource cs,
java.security.Principal principal)
Returns permissions associated with the principal, also with permissions inheritted from roles. |
java.security.PermissionCollection |
getPrincipalPermissions(java.security.CodeSource cs,
java.security.Principal principal,
boolean roleInheritted)
Returns permissions associated with the principal, optionally without permissions inheritted from roles. |
java.util.Iterator |
getRoleNames()
Returns iterator of role names. |
java.security.PermissionCollection |
getRolePermissions(java.lang.String roleName)
Get permissions owned by role. |
boolean |
isRoleManager()
It tests, whether this policy can manage roles or not. |
boolean |
isUpdatable()
It tests, whether this policy is really updateable or read-only. |
void |
refresh()
Refreshes and reloads the Policy. |
boolean |
removePermission(java.security.CodeSource cs,
java.security.Principal principal,
java.security.Permission permission)
Removes permission from specified principal. |
boolean |
removePermissionFromRole(java.lang.String roleName,
java.security.Permission permission)
Removes permission from role. |
Methods inherited from class org.systinet.security.policy.UpdateablePolicy |
createRole, deleteRole, destroy, getUpdateablePolicy, initSingleton, setUpdateablePolicy |
Methods inherited from class javax.security.auth.Policy |
getPolicy, setPolicy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Policy2UpdateablePolicy(java.util.Map initParams)
initParams
- not used, but required by WASP for construction using reflection APIpublic Policy2UpdateablePolicy(javax.security.auth.Policy policy)
policy
- the policy to wrapMethod Detail |
public boolean isUpdatable()
true
, otherwise it returns false
.
isUpdatable
in class UpdateablePolicy
false
if it is read-only, true
if it
is updatable (principal oriented methods are fully supported)public boolean isRoleManager()
true
, otherwise it returns false
.
isRoleManager
in class UpdateablePolicy
false
if it cannot manage roles, true
if it
can (role oriented methods are fully supported)public void refresh()
refresh
in class UpdateablePolicy
java.lang.SecurityException
- if the caller does not have permission to refresh the Policy.public java.security.PermissionCollection getPermissions(javax.security.auth.Subject subject, java.security.CodeSource codesource)
getPermissions
in class UpdateablePolicy
subject
- the Subject whose associated Principals, in conjunction with the provided CodeSource, determines the Permissions returned by this method. This parameter may be null.codesource
- the code specified by its CodeSource that determines, in conjunction with the provided Subject, the Permissions returned by this method. This parameter may be null.
public void addPermissions(java.security.CodeSource cs, java.security.Principal principal, java.security.PermissionCollection collection) throws java.security.AccessControlException
addPermissions
in class UpdateablePolicy
principal
- principalcs
- codesource for this permission (can be null
)collection
- collection of permissions to be added to <principal, code source> pair
java.security.AccessControlException
- the policy is read only or the caller is not authorized to invoke this methodpublic boolean addPermission(java.security.CodeSource cs, java.security.Principal principal, java.security.Permission permission) throws java.security.AccessControlException
addPermission
in class UpdateablePolicy
cs
- codesource for this
permission (can be null
)principal
- principalpermission
- permission to add
true
if the
permission was added, false
if it cannot be added,
because the principal already owns the permission.
java.security.AccessControlException
- access control rules disallows to perform requested operationpublic boolean removePermission(java.security.CodeSource cs, java.security.Principal principal, java.security.Permission permission) throws java.security.AccessControlException
removePermission
in class UpdateablePolicy
cs
- codesource for this
permission (can be null
)principal
- principalpermission
- the permission has to
match exactly (tested through equals method) to one of the
permissions already assigned to the principal.
true
if the
permission was removed, false
if it cannot be removed,
because the principal does not own the permission.
java.security.AccessControlException
- access control rules disallows to perform requested operationpublic java.security.PermissionCollection getPrincipalPermissions(java.security.CodeSource cs, java.security.Principal principal) throws java.security.AccessControlException
getPrincipalPermissions
in class UpdateablePolicy
cs
- codesource for this
permission (can be null
)principal
- principal (can be null
)
java.security.AccessControlException
- access control rules disallows to perform requested operationpublic java.security.PermissionCollection getPrincipalPermissions(java.security.CodeSource cs, java.security.Principal principal, boolean roleInheritted) throws java.security.AccessControlException
getPrincipalPermissions
in class UpdateablePolicy
cs
- codesource for this
permission (can be null
)principal
- principal (can be null
)roleInheritted
- true
means that the returned permissions also contain permissions inheritted
principal's roles
java.security.AccessControlException
- access control rules disallows to perform requested operationpublic PrincipalEntries getPrincipalEntries() throws java.security.AccessControlException
getPrincipalEntries
in class UpdateablePolicy
java.security.AccessControlException
- access control rules disallows to perform requested operationpublic PrincipalEntries getPrincipalEntries(java.security.Permission perm) throws java.security.AccessControlException
getPrincipalEntries
in class UpdateablePolicy
perm
- permission act as filter for the constructed result
java.security.AccessControlException
- access control rules disallows to perform requested operationpublic java.util.Iterator getRoleNames()
getRoleNames
in class UpdateablePolicy
public boolean addPermissionToRole(java.lang.String roleName, java.security.Permission permission)
addPermissionToRole
in class UpdateablePolicy
roleName
- role namepermission
- permission to add,
can be null
to cteate empty role entry
true
if the permission was added, false
if it cannot be
added
java.security.AccessControlException
- the caller is not authorized to invoke this methodpublic boolean removePermissionFromRole(java.lang.String roleName, java.security.Permission permission)
removePermissionFromRole
in class UpdateablePolicy
roleName
- role namepermission
- permission to remove (can be null to remove the role)
, the permission has to
match exactly (tested through equals method) to one of the
permissions already assigned to the role.
true
,
if the permission was removed; false
if it cannot be
added
java.security.AccessControlException
- the caller is not authorized to invoke this methodpublic java.security.PermissionCollection getRolePermissions(java.lang.String roleName)
getRolePermissions
in class UpdateablePolicy
roleName
- role name
java.security.AccessControlException
- the caller is not authorized to invoke this method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |