1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge branch '3.1.x'

* 3.1.x:
  [ticket/13950] Hide undefined categories
  [ticket/13950] Hide undefined permissions
This commit is contained in:
Tristan Darricau
2015-09-01 21:47:19 +02:00
2 changed files with 32 additions and 0 deletions

View File

@@ -159,6 +159,28 @@ class permissions
return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc';
}
/**
* 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
*