aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-09-01 21:47:19 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-09-01 21:47:19 +0200
commit5b8164a1bb911fb2df56affc5024652070cf35e4 (patch)
treeb820621ff2862616a2d326d7f3f1ef1f2c8ce93d /phpBB/phpbb
parent5e643ae750dcae3e5496759405ec8501e0e529d4 (diff)
parent8749c99e3453012d5fc8be199ed5a725e447b511 (diff)
downloadforums-5b8164a1bb911fb2df56affc5024652070cf35e4.tar
forums-5b8164a1bb911fb2df56affc5024652070cf35e4.tar.gz
forums-5b8164a1bb911fb2df56affc5024652070cf35e4.tar.bz2
forums-5b8164a1bb911fb2df56affc5024652070cf35e4.tar.xz
forums-5b8164a1bb911fb2df56affc5024652070cf35e4.zip
Merge branch '3.1.x'
* 3.1.x: [ticket/13950] Hide undefined categories [ticket/13950] Hide undefined permissions
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/permissions.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
index c462f72a73..0c6fad295c 100644
--- a/phpBB/phpbb/permissions.php
+++ b/phpBB/phpbb/permissions.php
@@ -160,6 +160,28 @@ class permissions
}
/**
+ * Checks if a category has been defined
+ *
+ * @param string $category Identifier of the category
+ * @return bool True if the category is defined, false otherwise
+ */
+ public function category_defined($category)
+ {
+ return isset($this->categories[$category]);
+ }
+
+ /**
+ * Checks if a permission has been defined
+ *
+ * @param string $permission Identifier of the permission
+ * @return bool True if the permission is defined, false otherwise
+ */
+ public function permission_defined($permission)
+ {
+ return isset($this->permissions[$permission]);
+ }
+
+ /**
* Returns the language string of a permission
*
* @param string $permission Identifier of the permission