org.apache.derby.iapi.security
Class SecurityUtil
- java.lang.Object
-
- org.apache.derby.iapi.security.SecurityUtil
-
public class SecurityUtil extends java.lang.ObjectThis class provides helper functions for security-related features.
-
-
Constructor Summary
Constructors Constructor and Description SecurityUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidauthorize(Securable operation)Raise an exception if the current user does not have permission to perform the indicated operation.static voidcheckSubjectHasPermission(javax.security.auth.Subject subject, java.security.Permission perm)Checks that a Subject has a Permission under the SecurityManager.static voidcheckUserHasPermission(java.lang.String user, java.security.Permission perm)Checks that a User has a Permission under the SecurityManager.static javax.security.auth.SubjectcreateSystemPrincipalSubject(java.lang.String user)Creates a (read-only) Subject representing a given user as a System user within Derby.
-
-
-
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
-
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- to run the encapsulated test: permission javax.security.auth.AuthPermission "doAsPrivileged";
- 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- to run the encapsulated test: permission javax.security.auth.AuthPermission "doAsPrivileged";
- Parameters:
user- the user to be check for having the permissionperm- the permission to be checked- Throws:
java.security.AccessControlException- if permissions are missing
-
authorize
public static void authorize(Securable operation) throws StandardException
Raise an exception if the current user does not have permission to perform the indicated operation.- Throws:
StandardException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG