public function run()
 {
     Permission::where('name', 'LIKE', 'support.category.%')->delete();
     Permission::create(['name' => 'support.category.show', 'display_name' => 'Show support category', 'description' => 'Permission to show a list of or a single category.']);
     Permission::create(['name' => 'support.category.create', 'display_name' => 'Create support category', 'description' => 'Permission to create a new category.']);
     Permission::create(['name' => 'support.category.edit', 'display_name' => 'Edit support category', 'description' => 'Permission to modify an existing category.']);
     Permission::create(['name' => 'support.category.destroy', 'display_name' => 'Delete support category', 'description' => 'Permission to delete an existing category.']);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     Permission::where('name', 'LIKE', 'menu.item.%')->delete();
     Permission::create(['name' => 'menu.item.show', 'display_name' => 'Show menu', 'description' => 'Permission to access the menu component.']);
     Permission::create(['name' => 'menu.item.create', 'display_name' => 'Create menu item', 'description' => 'Permission to create a new menu item.']);
     Permission::create(['name' => 'menu.item.edit', 'display_name' => 'Edit menu item', 'description' => 'Permission to modify an existing menu item.']);
     Permission::create(['name' => 'menu.item.destroy', 'display_name' => 'Delete menu item', 'description' => 'Permission to delete an existing menu item.']);
 }
Exemplo n.º 3
0
 public function store(PermissionRequest $request)
 {
     if (Auth::user()->can('create-permissions')) {
         $data = Permission::create($request->all());
         $permission = Permission::findOrFail($data->id);
         Session::flash('message', trans('auth::ui.permission.message_create', array('name' => $permission->name)));
         return redirect('auth/permission/create');
     }
     return redirect('auth/logout');
 }
 public function run()
 {
     Permission::where('name', 'site.page.show')->delete();
     Permission::create(['name' => 'site.page.show', 'display_name' => 'Show page', 'description' => 'Permission to show a list of or a single page.']);
     Permission::where('name', 'site.page.create')->delete();
     Permission::create(['name' => 'site.page.create', 'display_name' => 'Create page', 'description' => 'Permission to create a new page.']);
     Permission::where('name', 'site.page.edit')->delete();
     Permission::create(['name' => 'site.page.edit', 'display_name' => 'Edit page', 'description' => 'Permission to modify an existing page.']);
     Permission::where('name', 'site.page.destroy')->delete();
     Permission::create(['name' => 'site.page.destroy', 'display_name' => 'Delete page', 'description' => 'Permission to delete an existing page.']);
 }
 public function run()
 {
     Permission::where('name', 'user.user.show')->delete();
     Permission::create(['name' => 'user.user.show', 'display_name' => 'Show user', 'description' => 'Permission to show a list of or a single user.']);
     Permission::where('name', 'user.user.create')->delete();
     Permission::create(['name' => 'user.user.create', 'display_name' => 'Create user', 'description' => 'Permission to create a new user.']);
     Permission::where('name', 'user.user.edit')->delete();
     Permission::create(['name' => 'user.user.edit', 'display_name' => 'Edit user', 'description' => 'Permission to modify an existing user.']);
     Permission::where('name', 'user.user.destroy')->delete();
     Permission::create(['name' => 'user.user.destroy', 'display_name' => 'Delete user', 'description' => 'Permission to delete an existing user.']);
 }