org.apache.derby.iapi.security
Class SecurityUtil

java.lang.Object
  extended by org.apache.derby.iapi.security.SecurityUtil

public class SecurityUtil
extends java.lang.Object

This class provides helper functions for security-related features.


Constructor Summary
SecurityUtil()
           
 
Method Summary
static void checkSubjectHasPermission(javax.security.auth.Subject subject, java.security.Permission perm)
          Checks that a Subject has a Permission under the SecurityManager.
static void checkUserHasPermission(java.lang.String user, java.security.Permission perm)
          Checks that a User has a Permission under the SecurityManager.
static javax.security.auth.Subject createSystemPrincipalSubject(java.lang.String user)
          Creates a (read-only) Subject representing a given user as a System user within Derby.
private static java.lang.String getAuthorizationId(java.lang.String name)
          Returns the Authorization Identifier for a principal name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityUtil

public SecurityUtil()
Method Detail

createSystemPrincipalSubject

public static javax.security.auth.Subject createSystemPrincipalSubject(java.lang.String user)
Creates a (read-only) Subject representing a given user as a System user within Derby.

Parameters:
user - the user name
Returns:
a Subject representing the user by its exact and normalized name
See Also:
User Names & Authorization Identifiers in Derby

getAuthorizationId

private static java.lang.String getAuthorizationId(java.lang.String name)
Returns the Authorization Identifier for a principal name.

Parameters:
name - the name of the principal
Returns:
the authorization identifier for this principal

checkSubjectHasPermission

public static void checkSubjectHasPermission(javax.security.auth.Subject subject,
                                             java.security.Permission perm)
Checks that a Subject has a Permission under the SecurityManager. To perform this check the following policy grant is required or an AccessControlException will be raised detailing the cause.

Parameters:
subject - the subject representing the SystemPrincipal(s)
perm - the permission to be checked
Throws:
java.security.AccessControlException - if permissions are missing

checkUserHasPermission

public static void checkUserHasPermission(java.lang.String user,
                                          java.security.Permission perm)
Checks that a User has a Permission under the SecurityManager. To perform this check the following policy grant is required or an AccessControlException will be raised detailing the cause.

Parameters:
user - the user to be check for having the permission
perm - the permission to be checked
Throws:
java.security.AccessControlException - if permissions are missing

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.