示例#1
0
 /**
  * Add Permissions to group
  *
  * @param \SaleBoss\Models\Group    $group
  * @param array                     $permissions
  *
  * @return \SaleBoss\Models\Group
  */
 public function addPermissions(Group $group, array $permissions)
 {
     $group->setPermissionsAttribute($permissions, false);
     $group->save();
     return $group;
 }
示例#2
0
 /**
  * Add group permissions to defaults
  *
  * @param $group
  * @return void
  */
 protected function addDefaults(Group $group)
 {
     foreach ($group->getPermissions() as $key => $permission) {
         $this->defaults[$group->id][$key] = $permission;
     }
 }