capability table does not recognise changed capability.

capability table does not recognise changed capability.

by Lloyd Thomas -
Number of replies: 1

 I have changed the capability in my access.php file, upgraded the version.php file and rebuild database. but my changed capability does not reflect its new parameters.

// old.

     'mod/simplefeedback:submit' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

//new

    'mod/simplefeedback:submit' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'student' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW
)
),

lf I copy the new caoability as a new one and assign it to get_users_by_capability() funtion, it works as expected.

Is there a cache that I should be deleting?

Average of ratings: -
In reply to Lloyd Thomas

Re: capability table does not recognise changed capability.

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle does not change capability assignments after the initial installation, as that would overwrite any customisations made by the site admin.

You can either uninstall and reinstall the plugin, or you can manually update the site role definitions.

Average of ratings: Useful (2)