-
Improvement
-
Resolution: Fixed
-
Minor
-
2.9
-
PostgreSQL
-
MOODLE_29_STABLE
-
MOODLE_30_STABLE
-
MDL-50664_mod_data-ManageApprovedSetting -
I propose an additional yes/no-setting for database activities beside to the 'approval required' setting to allow/disallow managing (edit, delete) an entry by its owner when the entry is approved.
The attached patch does the following:
- add manageapproved database field to data table
- add setting 'manage approved entries' (default yes)
- add function 'data_user_can_manage_entry' to lib.php. This function checks whether the current user is allowed to manage the given record considering manageentries capability, data_in_readonly_period() result, ownership (determined by data_isowner()) and manageapproved setting.
- adjusts if statements (for restricting editing and deleting entries) at view.php:376 and lib.php:1252 to make use of the new data_user_can_manage_entry function