UPDATE Add Permission Provider

Added VIEW_DEVDOCS permsion code. This shoudl allow room later if module is expanded for User docs "VIEW_USERDOCS"
This commit is contained in:
Richard Rudy 2016-03-18 14:00:56 -04:00
parent 05741b1dcb
commit 50d0bc3774

View File

@ -12,7 +12,7 @@
* @package docsviewer * @package docsviewer
*/ */
class DocumentationViewer extends Controller class DocumentationViewer extends Controller implements PermissionProvider
{ {
/** /**
* @var array * @var array
@ -71,7 +71,7 @@ class DocumentationViewer extends Controller
* *
* @var string|array Optional permission check * @var string|array Optional permission check
*/ */
private static $check_permission = 'ADMIN'; private static $check_permission = 'VIEW_DEVDOCS';
/** /**
* @var array map of modules to edit links. * @var array map of modules to edit links.
@ -116,6 +116,21 @@ class DocumentationViewer extends Controller
} }
} }
/**
* Permission provider to allow more control over who can view docs
*
* @return array
*/
public function providePermissions() {
return array(
'VIEW_DEVDOCS' => array(
'name' => 'View Site Documentation',
'category' => 'Documentation',
)
);
}
/** /**
* Can the user view this documentation. Hides all functionality for private * Can the user view this documentation. Hides all functionality for private
* wikis. * wikis.