public function run()
 {
     DB::table(app("config")->get("auth-module::table_permissions"))->delete();
     //  Add Dashboard Permissions
     PermissionItem::addPermission('dashboard', 'Dashboard Access');
     //  Add Users Management Permissions
     PermissionItem::addPermission('manage_users', 'Users Management Rights');
 }
 public function removePermissionByKey($permission_key)
 {
     $permission = PermissionItem::findPermission($permission_key);
     if ($permission) {
         $this->removePermission($permission);
     }
 }
 public static function forDashboard()
 {
     return PermissionItem::findPermission("dashboard");
 }
示例#4
0
/**
 * Create Permission
 */
function addPermission($key, $description)
{
    return \Developeryamhi\AuthModule\PermissionItem::addPermission($key, $description);
}
 public function permissionExists($id = null, $value = null)
 {
     $exists = false;
     $id || ($id = Input::get("search_id"));
     $value || ($value = Input::get("search_value"));
     $permission = PermissionItem::alreadyExistingItem("permission_key", $value);
     if ($permission) {
         if (!$id || $id && $id != $permission->id) {
             $exists = true;
         }
     }
     if (Request::wantsJson()) {
         return Response::json(array('valid' => !$exists));
     }
     return $exists;
 }