Enum Scope
- java.lang.Object
-
- java.lang.Enum<Scope>
-
- org.cyclos.model.access.oidcclients.Scope
-
- All Implemented Interfaces:
Serializable,Comparable<Scope>,HasMessageKey
public enum Scope extends Enum<Scope> implements HasMessageKey
Supported OAuth 2 / OpenID Connect scopes
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCOUNT_HISTORYGet the full account history.ACCOUNT_STATUSGet the current account status.ADDRESSStandard address scope, which gives access to the user's physical address.ADS_READView advertisements (simple and webshop), both of the own user and of other users.ADS_WRITEManage advertisements (simple and webshop), as well as webshop settings, delivery methods, sales, etc.EMAILStandard email scope, which gives access to the user's e-mail address.OFFLINE_ACCESSStandard offline access scope, which enables refresh tokens.OPENIDStandard openid scope, which enables the OpenID Connect features.PAYMENTPerform payments.PHONEStandard phone scope, which gives access to the user's phone number.PROFILEStandard profile scope, which gives access to claims such as full name, login name, picture URL, custom fields and locale.PROFILE_READRead the full user profile.PROFILE_WRITEModify the full user profile.PURCHASEAdd items to the shopping cart and purchase.TICKETSCreate and manage tickets:to: Tickets to a specific user
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandependsOnOpenid()Returns whether this scope requires the openid scope in order to be enabledMessageKeygetMessageKey()List<String>getParameters()booleanisAllowAdmins()static booleanisOidc(String scope)Indicates whether this scope, or list of scopes separated by spaces, are standard of the OpenID Connect protocolstatic Scopeof(String value)Returns a scope by value, or null if not foundstatic Map<Scope,Map<String,String>>parse(String scope)Parses each scope together with its parametersStringtoString()static ScopevalueOf(String name)Returns the enum constant of this type with the specified name.static Scope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OPENID
public static final Scope OPENID
Standard openid scope, which enables the OpenID Connect features. When not requested, will be a plain OAuth2 authorization.
-
PROFILE
public static final Scope PROFILE
Standard profile scope, which gives access to claims such as full name, login name, picture URL, custom fields and locale.
-
EMAIL
public static final Scope EMAIL
Standard email scope, which gives access to the user's e-mail address.
-
PHONE
public static final Scope PHONE
Standard phone scope, which gives access to the user's phone number.
-
ADDRESS
public static final Scope ADDRESS
Standard address scope, which gives access to the user's physical address.
-
OFFLINE_ACCESS
public static final Scope OFFLINE_ACCESS
Standard offline access scope, which enables refresh tokens.
-
ACCOUNT_STATUS
public static final Scope ACCOUNT_STATUS
Get the current account status. Is never granted to administrators. Parameters:type: Restrict to a specific account type
-
ACCOUNT_HISTORY
public static final Scope ACCOUNT_HISTORY
Get the full account history. Is never granted to administrators. Parameters:type: Restrict to a specific account type
-
PAYMENT
public static final Scope PAYMENT
Perform payments. Is never granted to administrators. Parameters:to: Payments to a specific useramount: Payments with a specific amountcurrency: Payments with a specific currency. When an amount is specified, this must also be, unless the authenticated user have accounts in a single currency.
-
TICKETS
public static final Scope TICKETS
Create and manage tickets:to: Tickets to a specific user
-
PROFILE_READ
public static final Scope PROFILE_READ
Read the full user profile. Is never granted to administrators.
-
PROFILE_WRITE
public static final Scope PROFILE_WRITE
Modify the full user profile. Is never granted to administrators.
-
ADS_READ
public static final Scope ADS_READ
View advertisements (simple and webshop), both of the own user and of other users. Is never granted to administrators.
-
ADS_WRITE
public static final Scope ADS_WRITE
Manage advertisements (simple and webshop), as well as webshop settings, delivery methods, sales, etc. Is never granted to administrators.
-
PURCHASE
public static final Scope PURCHASE
Add items to the shopping cart and purchase. Also allows viewing the purchases.
-
-
Method Detail
-
values
public static Scope[] 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 (Scope c : Scope.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Scope 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
-
isOidc
public static boolean isOidc(String scope)
Indicates whether this scope, or list of scopes separated by spaces, are standard of the OpenID Connect protocol
-
parse
public static Map<Scope,Map<String,String>> parse(String scope)
Parses each scope together with its parameters- Throws:
IllegalArgumentException- If any scope name isn't recognized, of if a scope has an unrecognized parameter
-
dependsOnOpenid
public boolean dependsOnOpenid()
Returns whether this scope requires the openid scope in order to be enabled
-
getMessageKey
public MessageKey getMessageKey()
- Specified by:
getMessageKeyin interfaceHasMessageKey
-
isAllowAdmins
public boolean isAllowAdmins()
-
-