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
1 changed files with 17 additions and 2 deletions

View File

@ -12,7 +12,7 @@
* @package docsviewer
*/
class DocumentationViewer extends Controller
class DocumentationViewer extends Controller implements PermissionProvider
{
/**
* @var array
@ -71,7 +71,7 @@ class DocumentationViewer extends Controller
*
* @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.
@ -115,6 +115,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