public interface SecPolicyContext
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkPermission(Permission perm)
Throws a
SecurityException if the requested
access, specified by the given permission, is not permitted based
on the security policy currently in effect. |
void |
checkPermission(Permission perm,
Object context)
Throws a
SecurityException if the
specified security context is denied access to the resource
specified by the given permission. |
boolean |
enable() |
boolean enable()
void checkPermission(Permission perm)
SecurityException if the requested
access, specified by the given permission, is not permitted based
on the security policy currently in effect.
This method calls AccessController.checkPermission
with the given permission.
perm - the requested permission.SecurityException - if access is not permitted based on
the current security policy.NullPointerException - if the permission argument is
null.void checkPermission(Permission perm, Object context)
SecurityException if the
specified security context is denied access to the resource
specified by the given permission.
The context must be a security
context returned by a previous call to
getSecurityContext and the access control
decision is based upon the configured security policy for
that security context.
If context is an instance of
AccessControlContext then the
AccessControlContext.checkPermission method is
invoked with the specified permission.
If context is not an instance of
AccessControlContext then a
SecurityException is thrown.
perm - the specified permissioncontext - a system-dependent security context.SecurityException - if the specified security context
is not an instance of AccessControlContext
(e.g., is null), or is denied access to the
resource specified by the given permission.NullPointerException - if the permission argument is
null.SecurityManager.getSecurityContext(),
AccessControlContext.checkPermission(java.security.Permission)[Web Site]