/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $role = Role::admin();
     $acl = Foundation::acl();
     $actions = ['Manage Roles', 'Manage Acl'];
     $acl->actions()->attach($actions);
     $acl->allow($role->name, $actions);
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $admin = Role::admin();
     $member = Role::member();
     $acl = ACL::make('orchestra/story');
     $acl->roles()->attach([$member->name, $admin->name]);
     $acl->actions()->attach(['Create Post', 'Update Post', 'Delete Post', 'Manage Post', 'Create Page', 'Update Page', 'Delete Page', 'Manage Page']);
     $acl->allow($member->name, ['Create Post', 'Update Post', 'Delete Post', 'Create Page', 'Update Page', 'Delete Page']);
     $acl->allow($admin->name, ['Create Post', 'Update Post', 'Delete Post', 'Manage Post', 'Create Page', 'Update Page', 'Delete Page', 'Manage Page']);
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $admin = Role::admin();
     $member = Role::member();
     $acl = Acl::make('hostbrute/uppy');
     $acl->roles()->attach([$admin->name, $member->name]);
     //set up actions, php 5.4 style baby
     $adminActions = ['Manage Uppy'];
     $acl->actions()->attach($adminActions);
     $acl->allow($admin->name, $adminActions);
 }
Exemplo n.º 4
0
 /**
  * Attaches roles depending on the users active directory group.
  *
  * @param User       $user
  * @param AdldapUser $adldapUser
  */
 protected function handleLdapUserWasAuthenticated(User $user, AdldapUser $adldapUser)
 {
     if ($adldapUser->inGroup('Help Desk')) {
         $admin = Role::admin();
         if ($admin instanceof Role) {
             $user->attachRole($admin->getKey());
         }
     }
 }