- All Implemented Interfaces:
Serializable
,Comparable<App.AllowedMethods>
,Constable
- Enclosing class:
App
Represents HTTP methods allowed to be executed on a specific resource/type.
For example; the 'books' type can have a permission '{ "*" : ["GET"] }' which means
"give read-only permissions to everyone". It is backed by a map of resource names
(object types) to a set of allowed HTTP methods.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAllows DELETE method only.Deny all requests (no access).Allows GET method only.Allow unauthenticated requests (guest access).Restrict access to objects with creatorid matching that of auth user.ALlows PATCH method only.Allows POST method only.Allows PUT method only.Allows read methods: GET, same asGET
.Allows all HTTP methods (full access).Allows write methods: POST, PUT, PATCH and DELETE. -
Field Summary
Modifier and TypeFieldDescriptionstatic final EnumSet
<App.AllowedMethods> All methods allowed.static final EnumSet
<App.AllowedMethods> All methods allowed, except DELETE.static final EnumSet
<App.AllowedMethods> No methods allowed.static final EnumSet
<App.AllowedMethods> Only GET is allowed.static final EnumSet
<App.AllowedMethods> All methods allowed (*).static final EnumSet
<App.AllowedMethods> All methods allowed, except GET. -
Method Summary
Modifier and TypeMethodDescriptionstatic App.AllowedMethods
fromString
(String value) Constructs the enum from a string value.toString()
static App.AllowedMethods
Returns the enum constant of this class with the specified name.static App.AllowedMethods[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
GUEST
Allow unauthenticated requests (guest access). -
EMPTY
Deny all requests (no access). -
OWN
Restrict access to objects with creatorid matching that of auth user. -
READ_WRITE
Allows all HTTP methods (full access). -
GET
Allows GET method only. -
POST
Allows POST method only. -
PUT
Allows PUT method only. -
PATCH
ALlows PATCH method only. -
DELETE
Allows DELETE method only. -
READ_ONLY
Allows read methods: GET, same asGET
. -
WRITE_ONLY
Allows write methods: POST, PUT, PATCH and DELETE.
-
-
Field Details
-
ALL
All methods allowed. -
READ_AND_WRITE
All methods allowed (*). -
READ
Only GET is allowed. -
WRITE
All methods allowed, except GET. -
ALL_EXCEPT_DELETE
All methods allowed, except DELETE. -
NONE
No methods allowed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromString
Constructs the enum from a string value.- Parameters:
value
- a method name, or ?,w- Returns:
- an enum instance
-
toString
- Overrides:
toString
in classEnum<App.AllowedMethods>
-