mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-62273 Profile: Callback allows plugins to control profile access
Adds a new callback, <plugin>_control_view_profile. Plugins may return core_user::VIEWPROFILE_PREVENT to prevent access, core_user::VIEWPROFILE_DO_NOT_PREVENT to make no change, or core_user::VIEWPROFILE_FORCE_ALLOW to allow access even when Moodle would normally prevent it. This allows third-party plugins to restrict (or allow) access to profile pages in response to arbitrary business logic.
This commit is contained in:
parent
5b4ca9eb5b
commit
bef86c669c
2 changed files with 34 additions and 0 deletions
|
@ -82,6 +82,13 @@ class core_user {
|
|||
'alternatename'
|
||||
];
|
||||
|
||||
/** @var int Indicates that user profile view should be prevented */
|
||||
const VIEWPROFILE_PREVENT = -1;
|
||||
/** @var int Indicates that user profile view should not be prevented */
|
||||
const VIEWPROFILE_DO_NOT_PREVENT = 0;
|
||||
/** @var int Indicates that user profile view should be allowed even if Moodle would prevent it */
|
||||
const VIEWPROFILE_FORCE_ALLOW = 1;
|
||||
|
||||
/** @var stdClass keep record of noreply user */
|
||||
public static $noreplyuser = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue