Skip to content

Commit

Permalink
MDL-20712 using just $capablities for capability definition array, al…
Browse files Browse the repository at this point in the history
…l other files in db/* do not use component names in definition array; old capability array names are of course supported
  • Loading branch information
skodak committed Nov 4, 2009
1 parent e3acc8a commit 0ac940b
Show file tree
Hide file tree
Showing 64 changed files with 92 additions and 124 deletions.
2 changes: 1 addition & 1 deletion admin/report/courseoverview/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$report_courseoverview_capabilities = array(
$capabilities = array(

'report/courseoverview:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion admin/report/questioninstances/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$report_questioninstances_capabilities = array(
$capabilities = array(

'report/questioninstances:view' => array(
'captype' => 'read',
Expand Down
2 changes: 1 addition & 1 deletion admin/report/security/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$report_security_capabilities = array(
$capabilities = array(

'report/security:view' => array(
'riskbitmask' => RISK_CONFIG,
Expand Down
2 changes: 1 addition & 1 deletion admin/report/unittest/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$report_unittest_capabilities = array(
$capabilities = array(

'report/unittest:view' => array(
'riskbitmask' => RISK_DATALOSS,
Expand Down
2 changes: 1 addition & 1 deletion blocks/online_users/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$block_online_users_capabilities = array(
$capabilities = array(

'block/online_users:viewlist' => array(

Expand Down
9 changes: 3 additions & 6 deletions blocks/rss_client/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$block_rss_client_capabilities = array(
$capabilities = array(

'block/rss_client:manageownfeeds' => array(

Expand Down
2 changes: 1 addition & 1 deletion course/report/log/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$coursereport_log_capabilities = array(
$capabilities = array(

'coursereport/log:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion course/report/outline/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$coursereport_outline_capabilities = array(
$capabilities = array(

'coursereport/outline:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion course/report/participation/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$coursereport_participation_capabilities = array(
$capabilities = array(

'coursereport/participation:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion course/report/progress/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$coursereport_progress_capabilities = array(
$capabilities = array(

'coursereport/progress:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion course/report/stats/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// //
///////////////////////////////////////////////////////////////////////////

$coursereport_stats_capabilities = array(
$capabilities = array(

'coursereport/stats:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion enrol/authorize/db/access.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$enrol_authorize_capabilities = array(
$capabilities = array(

'enrol/authorize:managepayments' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/export/ods/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradeexport_ods_capabilities = array(
$capabilities = array(

'gradeexport/ods:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/export/txt/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradeexport_txt_capabilities = array(
$capabilities = array(

'gradeexport/txt:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/export/xls/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradeexport_xls_capabilities = array(
$capabilities = array(

'gradeexport/xls:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/export/xml/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradeexport_xml_capabilities = array(
$capabilities = array(

'gradeexport/xml:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/import/csv/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradeimport_csv_capabilities = array(
$capabilities = array(

'gradeimport/csv:view' => array(
'captype' => 'write',
Expand Down
2 changes: 1 addition & 1 deletion grade/import/xml/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradeimport_xml_capabilities = array(
$capabilities = array(

'gradeimport/xml:view' => array(
'captype' => 'write',
Expand Down
2 changes: 1 addition & 1 deletion grade/report/grader/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradereport_grader_capabilities = array(
$capabilities = array(

'gradereport/grader:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/report/outcomes/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradereport_outcomes_capabilities = array(
$capabilities = array(

'gradereport/outcomes:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/report/overview/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradereport_overview_capabilities = array(
$capabilities = array(

'gradereport/overview:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
2 changes: 1 addition & 1 deletion grade/report/user/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$gradereport_user_capabilities = array(
$capabilities = array(

'gradereport/user:view' => array(
'riskbitmask' => RISK_PERSONAL,
Expand Down
6 changes: 5 additions & 1 deletion lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3177,7 +3177,11 @@ function load_capability_def($component) {
$capabilities = array();
if (file_exists($defpath)) {
require($defpath);
$capabilities = ${$component.'_capabilities'};
if (!empty(${$component.'_capabilities'})) {
// legacy capability array name
// since 2.0 we prefer $capabilities instead - it is easier to use and matches db/* files
$capabilities = ${$component.'_capabilities'};
}
}

return $capabilities;
Expand Down
9 changes: 3 additions & 6 deletions lib/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$moodle_capabilities = array(
$capabilities = array(

'moodle/site:doanything' => array(

Expand Down
9 changes: 3 additions & 6 deletions mod/assignment/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$mod_assignment_capabilities = array(
$capabilities = array(

'mod/assignment:view' => array(

Expand Down
9 changes: 3 additions & 6 deletions mod/chat/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$mod_chat_capabilities = array(
$capabilities = array(

'mod/chat:chat' => array(

Expand Down
9 changes: 3 additions & 6 deletions mod/choice/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$mod_choice_capabilities = array(
$capabilities = array(

'mod/choice:choose' => array(

Expand Down
9 changes: 3 additions & 6 deletions mod/data/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$mod_data_capabilities = array(
$capabilities = array(

'mod/data:viewentry' => array(

Expand Down
9 changes: 3 additions & 6 deletions mod/feedback/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
// [mod/block]/<plugin_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
Expand All @@ -25,13 +25,10 @@
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
// The variable name for the capability definitions array is $capabilities


$mod_feedback_capabilities = array(
$capabilities = array(

'mod/feedback:view' => array(

Expand Down
2 changes: 1 addition & 1 deletion mod/folder/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$mod_folder_capabilities = array(
$capabilities = array(
/* TODO: review public portfolio API first!
'mod/folder:portfolioexport' => array(
Expand Down
Loading

0 comments on commit 0ac940b

Please sign in to comment.