Merge pull request #109 from zenmonkey/master

This commit is contained in:
Daniel Hensby 2016-11-07 13:30:57 +00:00
commit 9d7a1f6210
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
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 = '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