User permissions on their own dashboard

User permissions on their own dashboard

by Morgan Harris -
Number of replies: 0

Is there a way for users to be given permissions on their own dashboard? In other words, a capability defined like such:

'local/myplugin:changesettings' => [
        'captype' => 'write',
        'contextlevel' => CONTEXT_MODULE,
        'archetypes' => [
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'manager' => CAP_ALLOW
        ]
    ],

is there a way to define it such that has_capability('local/myplugin:changesettings', $users_own_context) returns true?

I'm looking for a solution that works in vanilla Moodle, without having to create a role especially for my plugin. It would be helpful if there were some kind of "self" role, which users were granted in their own context by default, but as far as I can tell the only role users have in their own context is "user", and they have that in every context.

Average of ratings: -