From 8737be587d5185e48c39808a4c9daf89a8315b7f Mon Sep 17 00:00:00 2001
From: moodler
Date: Sun, 13 Aug 2006 09:25:45 +0000
Subject: [PATCH] More language-related tidyups and a new get_local_override()
function
---
admin/roles/manage.html | 105 +++++++++++++++++++++-------------------
lang/en_utf8/role.php | 5 ++
lib/accesslib.php | 10 ++++
3 files changed, 71 insertions(+), 49 deletions(-)
diff --git a/admin/roles/manage.html b/admin/roles/manage.html
index c07d65e4ef..bf97a1467e 100755
--- a/admin/roles/manage.html
+++ b/admin/roles/manage.html
@@ -9,55 +9,62 @@
-
+
diff --git a/lang/en_utf8/role.php b/lang/en_utf8/role.php
index ec415fc04d..7c6d8d0b8b 100644
--- a/lang/en_utf8/role.php
+++ b/lang/en_utf8/role.php
@@ -2,11 +2,16 @@
// role.php
$string['assignroles'] = 'Assign roles';
+$string['allow'] = 'Allow';
+$string['capability'] = 'Capability';
$string['currentrole'] = 'Current role';
$string['currentcontext'] = 'Current context';
$string['existingusers'] = '$a existing users';
+$string['inherit'] = 'Inherit';
$string['overrideroles'] = 'Override roles';
$string['potentialusers'] = '$a potential users';
+$string['prevent'] = 'Prevent';
+$string['prohibit'] = 'Prohibit';
$string['site:doanything'] = 'Allowed to do everything';
$string['legacy:guest'] = 'LEGACY ROLE: Guest';
diff --git a/lib/accesslib.php b/lib/accesslib.php
index 66cf57bdda..4723cf046c 100755
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -828,6 +828,16 @@ function context_level($contextid) {
}
+/**
+ * Get the local override (if any) for a given capability in a role in a context
+ * @param $roleid
+ * @param $instance
+ */
+function get_local_override($roleid, $contextid, $capability) {
+ return get_record('role_capabilities', 'roleid', $roleid, 'capability', $capability, 'contextid', $contextid);
+}
+
+
/************************************
* DB TABLE RELATED FUNCTIONS *
--
2.39.5