Пример #1
0
 /**
  * Deletes permissions from all groups
  * @param  string $permission The permission to delete
  * @return boolean
  */
 public static function deletePermission($permission)
 {
     // Init
     $group_list = SentrySetup::getGroups();
     $group_list = Helpers::array_collate($group_list);
     $actions = [$permission];
     foreach ($group_list as $key => $val) {
         $permissions[$key][] = 0;
     }
     $input = compact('actions', 'permissions');
     try {
         SentrySetup::savePermissions($input);
         return true;
     } catch (Exception $e) {
         throw new Exception();
     }
 }
 public function postLabels()
 {
     // Init
     $labels_arr = Input::get('labels');
     try {
         SentrySetup::saveLabels($labels_arr);
         return redirect('sentry-setup/labels')->with('success', true);
     } catch (Exception $e) {
         return 'Fail';
     }
 }