mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
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:
parent
05741b1dcb
commit
50d0bc3774
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user