diff --git a/code/controllers/DocumentationViewer.php b/code/controllers/DocumentationViewer.php index 695b761..3a8143c 100755 --- a/code/controllers/DocumentationViewer.php +++ b/code/controllers/DocumentationViewer.php @@ -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 = 'CMS_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( + 'CMS_VIEW_DEVDOCS' => array( + 'name' => 'View Site Documentation', + 'category' => 'Documentation', + ) + ); + } /** * Can the user view this documentation. Hides all functionality for private