ScopeGroup ​
- Type
- Class
- Namespace
- craft\oauth
- Inherits
- craft\oauth\ScopeGroup
- Since
- 5.12.0
A set of OAuth scopes that users can grant to the personal access tokens they create on their Tokens screen, such as the scopes for one API.
The scopes must be defined by a registered OAuth craft\oauth\Resource.
Public Properties ​
| Property | Description |
|---|---|
| handle | |
| label | |
| scopes | |
| userScopes |
handle ​
- Default value
null
label ​
- Default value
null
scopes ​
- Default value
null
userScopes ​
- Default value
null
Public Methods ​
| Method | Description |
|---|---|
| __construct() | |
| scopesFor() | The scope IDs the user may grant to a token. |
__construct() ​
Arguments ​
$handle(string)$label(string) – The API name, shown when more than one group is available.$scopes(array<string,string>) – Scope IDs and their descriptions.$userScopes(Closure, null) – Returns the scope IDs, out of those given, that a user may grant. All of them by default. Signature:function(User $user, string[] $scopes): string[]
scopesFor() ​
The scope IDs the user may grant to a token.
Arguments ​
$user
Returns ​
string[]