From c511df7cb3dc768111c12a462159b2c38c4e7dd5 Mon Sep 17 00:00:00 2001 From: Gorrie Date: Tue, 26 Jan 2016 19:17:32 +1300 Subject: [PATCH] Added permissions --- code/DevTasks.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/DevTasks.php b/code/DevTasks.php index ed6a2c7..c327977 100644 --- a/code/DevTasks.php +++ b/code/DevTasks.php @@ -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', @@ -36,4 +39,10 @@ public function init() { CMSMenu::add_link($item, '', '#', $priority, $attributes); } } + + public function providePermissions() { + return array( + "VIEW_DEVTASKS" => "Access dev task menu", + ); + } }