- java.lang.Object
-
- java.lang.Enum<App.AllowedMethods>
-
- com.erudika.para.core.App.AllowedMethods
-
- All Implemented Interfaces:
Serializable,Comparable<App.AllowedMethods>
- Enclosing class:
- App
public static enum App.AllowedMethods extends Enum<App.AllowedMethods>
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.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DELETEAllows DELETE method only.EMPTYDeny all requests (no access).GETAllows GET method only.GUESTAllow unauthenticated requests (guest access).OWNRestrict access to objects with creatorid matching that of auth user.PATCHALlows PATCH method only.POSTAllows POST method only.PUTAllows PUT method only.READ_ONLYAllows read methods: GET, same asGET.READ_WRITEAllows all HTTP methods (full access).WRITE_ONLYAllows write methods: POST, PUT, PATCH and DELETE.
-
Field Summary
Fields Modifier and Type Field Description static EnumSet<App.AllowedMethods>ALLAll methods allowed.static EnumSet<App.AllowedMethods>ALL_EXCEPT_DELETEAll methods allowed, except DELETE.static EnumSet<App.AllowedMethods>NONENo methods allowed.static EnumSet<App.AllowedMethods>READOnly GET is allowed.static EnumSet<App.AllowedMethods>READ_AND_WRITEAll methods allowed (*).static EnumSet<App.AllowedMethods>WRITEAll methods allowed, except GET.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static App.AllowedMethodsfromString(String value)Constructs the enum from a string value.StringtoString()static App.AllowedMethodsvalueOf(String name)Returns the enum constant of this type with the specified name.static App.AllowedMethods[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GUEST
public static final App.AllowedMethods GUEST
Allow unauthenticated requests (guest access).
-
EMPTY
public static final App.AllowedMethods EMPTY
Deny all requests (no access).
-
OWN
public static final App.AllowedMethods OWN
Restrict access to objects with creatorid matching that of auth user.
-
READ_WRITE
public static final App.AllowedMethods READ_WRITE
Allows all HTTP methods (full access).
-
GET
public static final App.AllowedMethods GET
Allows GET method only.
-
POST
public static final App.AllowedMethods POST
Allows POST method only.
-
PUT
public static final App.AllowedMethods PUT
Allows PUT method only.
-
PATCH
public static final App.AllowedMethods PATCH
ALlows PATCH method only.
-
DELETE
public static final App.AllowedMethods DELETE
Allows DELETE method only.
-
READ_ONLY
public static final App.AllowedMethods READ_ONLY
Allows read methods: GET, same asGET.
-
WRITE_ONLY
public static final App.AllowedMethods WRITE_ONLY
Allows write methods: POST, PUT, PATCH and DELETE.
-
-
Field Detail
-
ALL
public static final EnumSet<App.AllowedMethods> ALL
All methods allowed.
-
READ_AND_WRITE
public static final EnumSet<App.AllowedMethods> READ_AND_WRITE
All methods allowed (*).
-
READ
public static final EnumSet<App.AllowedMethods> READ
Only GET is allowed.
-
WRITE
public static final EnumSet<App.AllowedMethods> WRITE
All methods allowed, except GET.
-
ALL_EXCEPT_DELETE
public static final EnumSet<App.AllowedMethods> ALL_EXCEPT_DELETE
All methods allowed, except DELETE.
-
NONE
public static final EnumSet<App.AllowedMethods> NONE
No methods allowed.
-
-
Method Detail
-
values
public static App.AllowedMethods[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (App.AllowedMethods c : App.AllowedMethods.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static App.AllowedMethods valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
fromString
public static App.AllowedMethods fromString(String value)
Constructs the enum from a string value.- Parameters:
value- a method name, or ?,w- Returns:
- an enum instance
-
toString
public String toString()
- Overrides:
toStringin classEnum<App.AllowedMethods>
-
-