diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-09-01 21:47:05 +0200 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-09-01 21:47:05 +0200 |
commit | 8749c99e3453012d5fc8be199ed5a725e447b511 (patch) | |
tree | 2c201364621ce31eaca9bde4e6c481ac485b4617 /phpBB/phpbb | |
parent | 4979d98aa939aa01262c9ea7795677d4c196387c (diff) | |
parent | af246483e2feb0a8fbfb81782da17fb5f8dda957 (diff) | |
download | forums-8749c99e3453012d5fc8be199ed5a725e447b511.tar forums-8749c99e3453012d5fc8be199ed5a725e447b511.tar.gz forums-8749c99e3453012d5fc8be199ed5a725e447b511.tar.bz2 forums-8749c99e3453012d5fc8be199ed5a725e447b511.tar.xz forums-8749c99e3453012d5fc8be199ed5a725e447b511.zip |
Merge pull request #3765 from Zoddo/ticket/13950
[ticket/13950] Hide undefined permissions
* Zoddo/ticket/13950:
[ticket/13950] Hide undefined categories
[ticket/13950] Hide undefined permissions
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/permissions.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index 82f59b5c20..42bbe443d1 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 |