Package com.illumon.iris.security
Class GuaranteedPermission
java.lang.Object
java.security.Permission
java.security.BasicPermission
com.illumon.iris.security.MetaPermission
com.illumon.iris.security.GuaranteedPermission
- All Implemented Interfaces:
Serializable,Guard
public class GuaranteedPermission extends MetaPermission
A custom Java security Permission that overrides a DeniedPermission, ensuring that a given property can be accessed
even if otherwise denied or not granted.
- See Also:
- Serialized Form
-
Field Summary
-
Method Summary
Modifier and Type Method Description booleanimplies(Permission p)Checks whether the given permission is implied by this one, as per the overview.static GuaranteedPermissionnewGuaranteedPermission(String targetClassName, String targetName, String targetActions)Instantiates aGuaranteedPermissionthat encapsulates a target permission of the indicated class, specified name and, optionally, actions.static GuaranteedPermissionnewGuaranteedPermission(Permission target)Instantiates aGuaranteedPermissionthat encapsulates the given target permission.Methods inherited from class java.security.BasicPermission
equals, getActions, hashCode, newPermissionCollection
-
Method Details
-
newGuaranteedPermission
@Permissions public static GuaranteedPermission newGuaranteedPermission(String targetClassName, @Nullable String targetName, @Nullable String targetActions)Instantiates aGuaranteedPermissionthat encapsulates a target permission of the indicated class, specified name and, optionally, actions.- Parameters:
targetClassName- The name of the class of the Permission to be allowed (even if otherwise denied).targetName- The target for the Permission to be allowed.targetActions- The actions (if any) to be specifically denied by the underlying class.- Throws:
IllegalArgumentException- if:targetClassNameisnull, the empty string, does not refer to a concretePermissiondescendant, or refers to anyMetaPermission.classorUnresolvedPermission.class.targetNameisnull.targetClassNamecannot be instantiated, and it's the caller's fault; e.g., becausetargetNameand/ortargetActionsdo not adhere to the naming constraints of the target class; or due to the target class not exposing a(String name), or(String name, String actions)constructor, depending on whethertargetActionsisnullor not.
SecurityException- if aSecurityManager,sm, is installed, and the invocationsm.checkPackageAccess(targetClassPackageName)(wheretargetClassPackageNameis the package of the class referred to bytargetClassName) denies access.
-
newGuaranteedPermission
Instantiates aGuaranteedPermissionthat encapsulates the given target permission.- Parameters:
target- The Permission that is being explicitly permitted (even if otherwise denied).- Throws:
IllegalArgumentException- iftargetisnull, aMetaPermission, or anUnresolvedPermission.
-
implies
Checks whether the given permission is implied by this one, as per the overview.- Overrides:
impliesin classMetaPermission- Parameters:
p- The Permission being checked.
-