|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.security.SecurityHelper
public class SecurityHelper
Security helper.
Constructor Summary | |
---|---|
SecurityHelper()
|
Method Summary | |
---|---|
static void |
addPermissions(java.security.PermissionCollection perms,
java.security.PermissionCollection permsToAdd)
Adds a collection of permsToAdd to a collection of existing permissions. |
static java.security.Principal |
createPrincipalFromFullPath(java.lang.String fullPath)
|
static javax.security.auth.Subject |
createSubject(java.lang.String principalName)
Utility method to create a subject. |
static java.security.Principal |
getBestPrincipal(java.security.Principal[] principals,
java.lang.Class classe)
Returns the first matching principal of a given type. |
static java.security.Principal |
getBestPrincipal(javax.security.auth.Subject subject,
java.lang.Class classe)
Given a subject, finds the first principal of the given classe for that subject. |
static PasswordCredential |
getPasswordCredential(javax.security.auth.Subject subject)
Given a subject, find the (first) PasswordCredential from the private credentials |
static java.lang.String |
getPreferencesFullPath(java.security.Principal principal)
Utility method used to retrieve the Preferences API absolute/full path from a given principal. |
static java.security.Principal |
getPrincipal(javax.security.auth.Subject subject,
java.lang.Class classe)
Given a subject, finds the first principal of the given classe for that subject. |
static java.util.List |
getPrincipals(javax.security.auth.Subject subject,
java.lang.Class classe)
Given a subject, finds all principals of the given classe for that subject. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SecurityHelper()
Method Detail |
---|
public static java.security.Principal getPrincipal(javax.security.auth.Subject subject, java.lang.Class classe)
Given a subject, finds the first principal of the given classe for that subject. If a principal of the given classe is not found, null is returned.
subject
- The subject supplying the principals.classe
- A class or interface derived from java.security.InternalPrincipal.
public static java.security.Principal getBestPrincipal(javax.security.auth.Subject subject, java.lang.Class classe)
Given a subject, finds the first principal of the given classe for that subject. If a principal of the given classe is not found, then the first other principal is returned. If the list is empty, null is returned.
subject
- The subject supplying the principals.classe
- A class or interface derived from java.security.InternalPrincipal.
public static java.security.Principal getBestPrincipal(java.security.Principal[] principals, java.lang.Class classe)
Returns the first matching principal of a given type.
principals
- The array of pricinpalsclasse
- The class of Principal
public static java.lang.String getPreferencesFullPath(java.security.Principal principal)
Utility method used to retrieve the Preferences API absolute/full path from a given principal.
principal
- The principal.
public static javax.security.auth.Subject createSubject(java.lang.String principalName)
Utility method to create a subject.
principalName
- The user principal name.
public static java.util.List getPrincipals(javax.security.auth.Subject subject, java.lang.Class classe)
Given a subject, finds all principals of the given classe for that subject. If no principals of the given class is not found, null is returned.
subject
- The subject supplying the principals.classe
- A class or interface derived from java.security.InternalPrincipal.
public static PasswordCredential getPasswordCredential(javax.security.auth.Subject subject)
Given a subject, find the (first) PasswordCredential from the private credentials
subject
- The subject
public static void addPermissions(java.security.PermissionCollection perms, java.security.PermissionCollection permsToAdd)
Adds a collection of permsToAdd to a collection of existing permissions.
perms
- The existing permissions.permsToAdd
- The permissions to add.public static java.security.Principal createPrincipalFromFullPath(java.lang.String fullPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |