Package io.quarkus.security
Class StringPermission
- java.lang.Object
-
- java.security.Permission
-
- io.quarkus.security.StringPermission
-
- All Implemented Interfaces:
Serializable,Guard
public final class StringPermission extends Permission
Represents permission based on simple string comparison.- See Also:
Permission, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTIONS_SEPARATOR
-
Constructor Summary
Constructors Constructor Description StringPermission(String permissionName, String... actions)Constructs a permission with the specified name and actions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object p)StringgetActions()inthashCode()booleanimplies(Permission p)Checks if this StringPermission object "implies" the specified permission.-
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
-
-
-
-
Field Detail
-
ACTIONS_SEPARATOR
public static final String ACTIONS_SEPARATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringPermission
public StringPermission(String permissionName, String... actions)
Constructs a permission with the specified name and actions.- Parameters:
permissionName- must not be null or empty and must not contain commaactions- optional actions; action itself must not be null or empty and must not contain comma
-
-
Method Detail
-
implies
public boolean implies(Permission p)
Checks if this StringPermission object "implies" the specified permission.More precisely, this method returns true if:
-
pis an instance of the StringPermission -
p's name equals this object's name - compared permissions have no actions, or this object's actions contains at least one of the
pactions
- Specified by:
impliesin classPermission- Parameters:
p- the permission to check against- Returns:
- true if the specified permission is implied by this object
-
-
equals
public boolean equals(Object p)
- Specified by:
equalsin classPermission
-
hashCode
public int hashCode()
- Specified by:
hashCodein classPermission
-
getActions
public String getActions()
- Specified by:
getActionsin classPermission- Returns:
- null if no actions were specified, or actions joined together with the
ACTIONS_SEPARATOR
-
-