interacts_with_auth
trait interacts_with_auth
Trait handling authentication and authorization logic for controllers.
Properties
| protected bool | $require_login | ||
| protected bool | $require_sesskey | ||
| protected bool | $required_login | ||
| protected array | $capabilities | ||
| Request | $request | ||
| mixed | $course | ||
| mixed | $cm |
Methods
void
set_require_login(mixed $course = null, mixed $cm = null)
Set if login is required and set related options.
void
set_require_sesskey(bool $require = true)
Define the requirement of sesskey validation for non-idempotent requests.
void
set_require_capabilities(array $capabilities)
Define the capabilities that the user must have.
void
require_login()
Ensure the user is logged in if required.
void
check_capabilities()
Check if the user has the required capabilities.
Details
at line 48
void
set_require_login(mixed $course = null, mixed $cm = null)
Set if login is required and set related options.
at line 58
void
set_require_sesskey(bool $require = true)
Define the requirement of sesskey validation for non-idempotent requests.
at line 66
void
set_require_capabilities(array $capabilities)
Define the capabilities that the user must have.
at line 76
protected void
require_login()
Ensure the user is logged in if required.
at line 97
protected void
check_capabilities()
Check if the user has the required capabilities.