AccessController
MMO\oauth\controllers · 1 symbol · generated 5 Oct 2026
AccessController
AccessController.php:36- Namespace
MMO\oauth\controllers- Extends
- aController
- Todo
- implements route to get a token from a client and set the token in the authorization header
Index
| CSRF_KEY | ||
| allowAnonymous | ||
| allowUserCreationWithCode | ||
| anonymousScopes | ||
| clients | ||
| codeAuthentifiers | ||
| dataControllers | ||
| heldScopes | ||
| holder | ||
| loginTpl | ||
| privateCollections | ||
| privateKey | ||
| publicKey | ||
| rightsCollections | ||
| rightsScope | ||
| route | ||
| superScope | ||
| user | ||
| carriesRights($entity) | Tell if $entity carries rights: a role (any change), a client whose scopes or roles changed, a token, an entity of | |
| checkCommitRights($entity) | Check that the client of a data api request can write $entity, if it carries rights or is private (carriesRights, $privateCollections): it held $rightsScope (or it changes its own pr… | |
| checkCommitScopes($entity) | Check that the user can commit $entity's changes: its status, its creation, its changes or its removal | |
| collectionValue($values, $collection) | ||
| doLogin($route) | ||
| extractUser($route) | ||
| filterPrivate($query) | Leave out of a data api listing what $privateCollections keep from a client without the rights: a collection none, the tokens of others, and opacify the other clients of a collection self,… | |
| forgotPassword($route) | ||
| getCodeAuthentifier() | ||
| getRedirectUri($route, $default) | ||
| getUser() | ||
| hasUserScope($uid) | Check if user or anonymous user has a given scope | |
| hideRecursiveContent($contents, $required) | Hide recursively the children content base on user scopes: pages.{path}, and the scopes the content and its parents ask besides (Content::$scopes: admin for a folder of administration pages) | |
| holds($scope) | Tell if the client of the request held $scope when the request started: what it changed since (its own role, its own scopes) is left aside | |
| holdsRights() | ||
| isDataApi() | Tell if the current route is one of the generic data api ($dataControllers), which serves any collection by its name and writes whatever properties its client sends | |
| isLeftToItsModule($value) | Tell if the rights on an entity, or on a collection, are its module's to check (iGuarded): everywhere but in the routes of the generic data api ($dataControllers), where the data.* scop… | |
| isOwn($entity) | ||
| isUserAllowed($uids) | Check if user or anonymous user is allowed to do something | |
| listRecursiveContentScope($request, $content) | ||
| login($route) | ||
| loginJSON($route) | ||
| logout($route) | ||
| onCommit($commit) | ||
| onPageContents($pageContents) | Filter content using scopes pages.* | |
| onQuery($query) | ||
| onRoute($route) | ||
| onScopes($request) | ||
| opacifyPrivateReferences($entity, $depth) | Opacify the entities of a private collection ($privateCollections) that $entity references, but the client's own: a group listing its users shows their uid and title only. | |
| privacyOf($collection) | ||
| renderNoToken($route, $exception) | ||
| resetPassword($route) | ||
| routeCreateUser($route) | ||
| routeGetUserConfig($route) | ||
| routePutUserConfig($route) | ||
| routeScopes($route) |
Constants1
CSRF_KEY
Properties17
allowAnonymous
- Type
- bool
allowUserCreationWithCode
- Type
- bool
anonymousScopes
- Type
- array
clients
- Type
- ClientRepository
codeAuthentifiers
- Type
- null | Collection
dataControllers
- Type
- array
heldScopes
holder
loginTpl
- Type
- string
privateCollections
- Type
- array
privateKey
- Type
- PrivateKey
publicKey
- Type
- PublicKey
rightsCollections
- Type
- array
rightsScope
- Type
- string
- See
$privateCollectionsin full. An application whose administrators hold another scope names it (admin)
route
- Type
- Route
superScope
- Type
- string
user
Methods36
carriesRights($entity)
AccessController.php:200Tell if $entity carries rights: a role (any change), a client whose scopes or roles changed, a token, an entity of
checkCommitRights($entity)
AccessController.php:215Check that the client of a data api request can write $entity, if it carries rights or is private (carriesRights, $privateCollections): it held $rightsScope (or it changes its own private entity, but not its rights), and, without $superScope, it neither changes its own rights nor writes rights granting that scope
checkCommitScopes($entity)
AccessController.php:460Check that the user can commit $entity's changes: its status, its creation, its changes or its removal
collectionValue($values, $collection)
AccessController.php:180| $values | array | |
| $collection | iCollection | |
| returns | mixed | the value $values gives $collection, or null |
doLogin($route)
AccessController.php:552| $route | Route | |
| returns | AccessToken |
extractUser($route)
AccessController.php:288filterPrivate($query)
AccessController.php:242Leave out of a data api listing what $privateCollections keep from a client without the rights: a collection none, the tokens of others, and opacify the other clients of a collection self, wherever they are referenced
forgotPassword($route)
AccessController.php:512getCodeAuthentifier()
AccessController.php:103| returns | null | CodeAuthentifier |
getRedirectUri($route, $default)
AccessController.php:294getUser()
AccessController.php:98hasUserScope($uid)
AccessController.php:122Check if user or anonymous user has a given scope
hideRecursiveContent($contents, $required)
AccessController.php:384Hide recursively the children content base on user scopes: pages.{path}, and the scopes the content and its parents ask besides (Content::$scopes: admin for a folder of administration pages)
holds($scope)
AccessController.php:159Tell if the client of the request held $scope when the request started: what it changed since (its own role, its own scopes) is left aside
holdsRights()
AccessController.php:164| returns | bool | true if the client of the request writes rights and reads $privateCollections in full |
isDataApi()
AccessController.php:144Tell if the current route is one of the generic data api ($dataControllers), which serves any collection by its name and writes whatever properties its client sends
| returns | bool |
isLeftToItsModule($value)
AccessController.php:134Tell if the rights on an entity, or on a collection, are its module's to check (iGuarded): everywhere but in the routes of the generic data api ($dataControllers), where the data.* scopes decide, as for any other
| $value | iEntity | iCollection | |
| returns | bool |
isOwn($entity)
AccessController.php:190isUserAllowed($uids)
AccessController.php:112Check if user or anonymous user is allowed to do something
listRecursiveContentScope($request, $content)
AccessController.php:476| $request | ScopesList | |
| $content | Content | |
| returns | void |
login($route)
AccessController.php:582loginJSON($route)
AccessController.php:576logout($route)
AccessController.php:506onCommit($commit)
AccessController.php:436onPageContents($pageContents)
AccessController.php:398Filter content using scopes pages.*
| $pageContents | PageContents | |
| returns | void |
onQuery($query)
AccessController.php:405onRoute($route)
AccessController.php:306onScopes($request)
AccessController.php:484| $request | ScopesList | |
| returns | void |
opacifyPrivateReferences($entity, $depth)
AccessController.php:268Opacify the entities of a private collection ($privateCollections) that $entity references, but the client's own: a group listing its users shows their uid and title only. Embedded entities are looked into
privacyOf($collection)
AccessController.php:169| $collection | iCollection | |
| returns | null | string | how $privateCollections serve $collection to a client without the rights: self, none or null (in full) |
renderNoToken($route, $exception)
AccessController.php:355resetPassword($route)
AccessController.php:533routeCreateUser($route)
AccessController.php:671routeGetUserConfig($route)
AccessController.php:704routePutUserConfig($route)
AccessController.php:689| $route | Route | |
| returns |
routeScopes($route)
AccessController.php:716Inherited members (55)
| Constants | Declared by | Description | |
|---|---|---|---|
ALERT | iLogLevel | Alert: Action must be taken immediately. | |
ALL | iLogLevel | Mask for all | |
ALL_PLUS | iLogLevel | debug everything | |
BACKTRACE | iLogLevel | ||
CRITICAL | iLogLevel | Critical: Critical conditions. | |
DEBUG | iLogLevel | Debug: Detailed debug information. | |
DEEP | iLogLevel | debug everything with arguments | |
EMERGENCY | iLogLevel | Emergency: System is unusable. | |
ERROR | iLogLevel | Error: Runtime errors that do not require immediate action but should typically be logged and monitored. | |
ERROR_PLUS | iLogLevel | Mask for all error | |
FATAL | iLogLevel | Mask for all fatal error | |
INFO | iLogLevel | Info: Interesting events. | |
INFO_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
MEMORY | iLogLevel | include backtrace object | |
NOTICE | iLogLevel | Notice: Normal but significant events. | |
NOTICE_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
TRACE | iLogLevel | include backtrace as origins | |
WARNING | iLogLevel | Warning: Exceptional occurrences that are not errors. | |
WARNING_PLUS | iLogLevel | Mask for all errors and warnings |
| Properties | Declared by | Description | |
|---|---|---|---|
verbosity | aModule |
| Methods | Declared by | Description | |
|---|---|---|---|
alert($message, $context) | aModule | Action must be taken immediately. | |
backtraces($message, $context) | aModule | Force-log a message at INFO level together with a full stack trace/memory snapshot (iLogLevel::BACKTRACE), bypassing the verbosity mask entirely (any non-zero verbosity is enough to trigger it). | |
Configure($config) | aModule | Merge $config into this module's configuration in the shared Configuration. | |
critical($message, $context) | aModule | Critical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask. | |
debug($message, $context) | aModule | Detailed debug information. | |
debugName() | aModule | Human-readable identifier used as the default {origin} in this instance's log messages. | |
DefaultConfig() | aModule | The config a module starts from before anything loaded via Configuration is merged in. | |
emergency($message, $context) | aModule | System is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask. | |
error($message, $context) | aModule | Runtime errors that do not require immediate action but should typically be logged and monitored. | |
ExtractRoutes($config) | aController | Extract all the APIRoute from this class, regardless of the fact they are registered in the application | |
getVerbosity() | aModule | ||
HasRoutes() | aController | Tells if any APIRoute are registered in the application | |
info($message, $context) | aModule | Interesting events. No-op if INFO is currently filtered out by the verbosity mask. | |
Instantiate($config) | aModule | (Re)create the shared instance immediately, configured with $config merged into the class's existing config. | |
IsShared() | aModule | ||
Link($method, $data) | aController | Build a Link (URL + label/icon/description/title, taken from the route's APIRoute metadata) for a registered route. | |
log($level, $message, $context) | aModule | Logs with an arbitrary level. | |
notice($message, $context) | aModule | Normal but significant events. | |
offsetExists($key) | aModule | \ArrayAccess::offsetExists -- tells whether $key is a declared property at all, regardless of whether it is currently readable/writable through array access. | |
offsetGet($key) | aModule | \ArrayAccess::offsetGet -- reads a property directly, unless it has a #[Serialize(serialize: 'methodName')] attribute, in which case that zero-argument method is called instead (e.g. | |
offsetSet($key, $value) | aModule | \ArrayAccess::offsetSet -- sets a property directly, unless it has a #[Serialize(unserialize: 'methodName')] attribute, in which case that method is called with $value instead (e.g. | |
offsetUnset($key) | aModule | \ArrayAccess::offsetUnset -- equivalent to $module[$key] = null. | |
Route($method) | aController | Get a registered APIRoute WARNING: if this class was not registered in the application, it will return null. | |
Routes() | aController | Get a list of registered APIRoutes (from this class) in the application WARNING: if this class was not registered in the application, it will return an empty array. | |
serialize($path, $serializer) | aModule | \MMO\core\interfaces\iSerializable::serialize -- exports every property (via | |
setVerbosity($verb) | aModule | Set the current verbosity mask, replacing whatever it was before. | |
Shared() | aModule | Get the shared instance, creating (and configuring) it on first call. | |
testVerbosity($level) | aModule | Test whether a given level (or set of levels) is currently enabled by this instance's verbosity mask. | |
traitUnshare($serialize) | aModule | Remove the shared instance, so the next Shared() call creates a fresh one. | |
unserialize($data, $path, $instances) | aModule | \MMO\core\interfaces\iSerializable::unserialize -- merges $data onto DefaultConfig, runs it through the (possibly overridden) constructor, then applies each resulting value to its property (via | |
Unshare($serialize) | aModule | Like tSingleton::Unshare, but also disconnects this module's instance from every event it was listening to (via Event::DisconnectListeners) before dropping it. | |
Url($method, $data) | aController | Build the URL for a registered route, filling in any {placeholder} from $data. | |
warning($message, $context) | aModule | Exceptional occurrences that are not errors. | |
__construct($config) | aModule | protected constructor, so it is not possible to do new Module(...) called by the serialization process just before being injected with data. | |
__wakeup() | aController | Called automatically right after the controller's shared instance is built (aModule::unserialize): registers onRoute as a Route listener with a low priority (-10), so it… |