// //
///////////////////////////////////////////////////////////////////////////
-$report_courseoverview_capabilities = array(
+$capabilities = array(
'report/courseoverview:view' => array(
'riskbitmask' => RISK_PERSONAL,
// //
///////////////////////////////////////////////////////////////////////////
-$report_questioninstances_capabilities = array(
+$capabilities = array(
'report/questioninstances:view' => array(
'captype' => 'read',
// //
///////////////////////////////////////////////////////////////////////////
-$report_security_capabilities = array(
+$capabilities = array(
'report/security:view' => array(
'riskbitmask' => RISK_CONFIG,
// //
///////////////////////////////////////////////////////////////////////////
-$report_unittest_capabilities = array(
+$capabilities = array(
'report/unittest:view' => array(
'riskbitmask' => RISK_DATALOSS,
// //
///////////////////////////////////////////////////////////////////////////
-$block_online_users_capabilities = array(
+$capabilities = array(
'block/online_users:viewlist' => array(
//
// 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.
//
// 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(
// //
///////////////////////////////////////////////////////////////////////////
-$coursereport_log_capabilities = array(
+$capabilities = array(
'coursereport/log:view' => array(
'riskbitmask' => RISK_PERSONAL,
// //
///////////////////////////////////////////////////////////////////////////
-$coursereport_outline_capabilities = array(
+$capabilities = array(
'coursereport/outline:view' => array(
'riskbitmask' => RISK_PERSONAL,
// //
///////////////////////////////////////////////////////////////////////////
-$coursereport_participation_capabilities = array(
+$capabilities = array(
'coursereport/participation:view' => array(
'riskbitmask' => RISK_PERSONAL,
// //
///////////////////////////////////////////////////////////////////////////
-$coursereport_progress_capabilities = array(
+$capabilities = array(
'coursereport/progress:view' => array(
'riskbitmask' => RISK_PERSONAL,
// //
///////////////////////////////////////////////////////////////////////////
-$coursereport_stats_capabilities = array(
+$capabilities = array(
'coursereport/stats:view' => array(
'riskbitmask' => RISK_PERSONAL,
<?php
-$enrol_authorize_capabilities = array(
+$capabilities = array(
'enrol/authorize:managepayments' => array(
'riskbitmask' => RISK_PERSONAL,
// 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,
// 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,
// 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,
// 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,
// 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',
// 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',
// 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,
// 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,
// 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,
// 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,
$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;
//
// 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.
//
// 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(
//
// 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.
//
// 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(
//
// 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.
//
// 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(
//
// 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.
//
// 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(
//
// 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.
//
// 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(
//
// 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.
//
// 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(
* @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(
//
// 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.
//
// 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_forum_capabilities = array(
+$capabilities = array(
'mod/forum:viewdiscussion' => array(
//
// 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.
//
// 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_glossary_capabilities = array(
+$capabilities = array(
'mod/glossary:write' => array(
//
// 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.
//
// 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_hotpot_capabilities = array(
+$capabilities = array(
'mod/hotpot:attempt' => array(
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$mod_imscp_capabilities = array(
+$capabilities = array(
/* TODO: review public portfolio API first!
'mod/imscp:portfolioexport' => array(
*
* For naming conventions, see lib/db/access.php.
*/
-$mod_lesson_capabilities = array(
+$capabilities = array(
'mod/lesson:edit' => array(
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$mod_page_capabilities = array(
+$capabilities = array(
/* TODO: review public portfolio API first!
'mod/page:portfolioexport' => array(
*
* For naming conventions, see lib/db/access.php.
*/
-$mod_quiz_capabilities = array(
+$capabilities = array(
// Ability to see that the quiz exists, and the basic information
// about it, for example the start date and time limit.
*
* For naming conventions, see lib/db/access.php.
*/
-$quiz_statistics_capabilities = array(
+$capabilities = array(
'quizreport/statistics:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$mod_resource_capabilities = array(
+$capabilities = array(
/* TODO: review public portfolio API first!
'mod/resource:portfolioexport' => array(
//
// 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.
//
// 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_scorm_capabilities = array(
+$capabilities = array(
'mod/scorm:viewreport' => array(
//
// 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.
//
// 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_survey_capabilities = array(
+$capabilities = array(
'mod/survey:participate' => array(
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$mod_url_capabilities = array(
+$capabilities = array(
/* TODO: review public portfolio API first!
'mod/url:portfolioexport' => array(
*
* For naming conventions, see lib/db/access.php.
*/
-$mod_wiki_capabilities = array(
+$capabilities = array(
'mod/wiki:participate' => array(
<?php
-$repository_alfresco_capabilities = array(
+$capabilities = array(
'repository/alfresco:view' => array(
'captype' => 'read',
<?php
-$repository_boxnet_capabilities = array(
+$capabilities = array(
'repository/boxnet:view' => array(
'captype' => 'read',
<?php
-$repository_draft_capabilities = array(
+$capabilities = array(
'repository/draft:view' => array(
'captype' => 'read',
<?php
-$repository_filesystem_capabilities = array(
+$capabilities = array(
'repository/filesystem:view' => array(
'captype' => 'read',
<?php
-$repository_flickr_capabilities = array(
+$capabilities = array(
'repository/flickr:view' => array(
'captype' => 'read',
<?php
-$repository_flickr_public_capabilities = array(
+$capabilities = array(
'repository/flickr_public:view' => array(
'captype' => 'read',
<?php
-$repository_googledocs_capabilities = array(
+$capabilities = array(
'repository/googledocs:view' => array(
'captype' => 'read',
<?php
-$repository_local_capabilities = array(
+$capabilities = array(
'repository/local:view' => array(
'captype' => 'read',
<?php
-$repository_mahara_capabilities = array(
+$capabilities = array(
'repository/mahara:view' => array(
'captype' => 'read',
<?php
-$repository_picasa_capabilities = array(
+$capabilities = array(
'repository/picasa:view' => array(
'captype' => 'read',
<?php
-$repository_remotemoodle_capabilities = array(
+$capabilities = array(
'repository/remotemoodle:view' => array(
'captype' => 'read',
<?php
-$repository_s3_capabilities = array(
+$capabilities = array(
'repository/s3:view' => array(
'captype' => 'read',
<?php
-$repository_upload_capabilities = array(
+$capabilities = array(
'repository/upload:view' => array(
'captype' => 'read',
<?php
-$repository_url_capabilities = array(
+$capabilities = array(
'repository/url:view' => array(
'captype' => 'read',
<?php
-$repository_webdav_capabilities = array(
+$capabilities = array(
'repository/webdav:view' => array(
'captype' => 'read',
<?php
-$repository_wikimedia_capabilities = array(
+$capabilities = array(
'repository/wikimedia:view' => array(
'captype' => 'read',
<?php
-$repository_youtube_capabilities = array(
+$capabilities = array(
'repository/youtube:view' => array(
'captype' => 'read',
<?php
-$webservice_amf_capabilities = array(
+$capabilities = array(
'webservice/amf:use' => array(
'captype' => 'read', // in fact this may be considered read and write at the same time
<?php
-$webservice_rest_capabilities = array(
+$capabilities = array(
'webservice/rest:use' => array(
'captype' => 'read', // in fact this may be considered read and write at the same time
<?php
-$webservice_soap_capabilities = array(
+$capabilities = array(
'webservice/soap:use' => array(
'captype' => 'read', // in fact this may be considered read and write at the same time
<?php
-$webservice_xmlrpc_capabilities = array(
+$capabilities = array(
'webservice/xmlrpc:use' => array(
'captype' => 'read', // in fact this may be considered read and write at the same time