|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.security.SecurityHelper
public class SecurityHelper
Security helper.
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
SecurityHelper()
|
Method Summary | |
---|---|
static void |
addPermissions(PermissionCollection perms,
PermissionCollection permsToAdd)
Adds a collection of permsToAdd to a collection of existing permissions. |
static Principal |
createPrincipalFromFullPath(String fullPath)
|
static Subject |
createSubject(String principalName)
Utility method to create a subject. |
static Principal |
getBestPrincipal(Principal[] principals,
Class classe)
Returns the first matching principal of a given type. |
static Principal |
getBestPrincipal(Subject subject,
Class classe)
Given a subject, finds the first principal of the given classe for that subject. |
static org.apache.jetspeed.security.PasswordCredential |
getPasswordCredential(Subject subject)
Given a subject, find the (first) PasswordCredential from the private credentials |
static String |
getPreferencesFullPath(Principal principal)
Utility method used to retrieve the Preferences API absolute/full path from a given principal. |
static Principal |
getPrincipal(Subject subject,
Class classe)
Given a subject, finds the first principal of the given classe for that subject. |
static List |
getPrincipals(Subject subject,
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 |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public SecurityHelper()
Method Detail |
---|
public static Principal getPrincipal(Subject subject, 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 Principal getBestPrincipal(Subject subject, 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 Principal getBestPrincipal(Principal[] principals, Class classe)
Returns the first matching principal of a given type.
principals
- The array of pricinpalsclasse
- The class of Principal
public static String getPreferencesFullPath(Principal principal)
Utility method used to retrieve the Preferences API absolute/full path from a given principal.
principal
- The principal.
public static Subject createSubject(String principalName)
Utility method to create a subject.
principalName
- The user principal name.
public static List getPrincipals(Subject subject, 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 org.apache.jetspeed.security.PasswordCredential getPasswordCredential(Subject subject)
Given a subject, find the (first) PasswordCredential from the private credentials
subject
- The subject
public static void addPermissions(PermissionCollection perms, PermissionCollection permsToAdd)
Adds a collection of permsToAdd to a collection of existing permissions.
perms
- The existing permissions.permsToAdd
- The permissions to add.public static Principal createPrincipalFromFullPath(String fullPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |