Skip to content

Commit

Permalink
Merge pull request #14 from gorriecoe/added-permissions
Browse files Browse the repository at this point in the history
Added permissions
  • Loading branch information
mediabeastnz committed Jan 26, 2016
2 parents 1e54e04 + c511df7 commit 9c66dfd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion code/DevTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
* @package DevTasks
*
*/
class DevTasks extends LeftAndMainExtension {
class DevTasks extends LeftAndMainExtension implements PermissionProvider {
public function init() {
parent::init();
if(!Permission::check("VIEW_DEVTASKS")) return;

$tasks = array(
'devbuild' => array(
'title' => 'Dev/Build',
Expand Down Expand Up @@ -36,4 +39,10 @@ public function init() {
CMSMenu::add_link($item, '', '#', $priority, $attributes);
}
}

public function providePermissions() {
return array(
"VIEW_DEVTASKS" => "Access dev task menu",
);
}
}

0 comments on commit 9c66dfd

Please sign in to comment.