Skip to content

Commit

Permalink
refactor(Core): 签到管理权限默认勾选在创始人角色
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 13, 2018
1 parent 2f2dc32 commit 46e7b66
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace SlimKit\PlusCheckIn\Seeds;

use Zhiyi\Plus\Models\Role;
use Zhiyi\Plus\Models\Ability;
use Illuminate\Database\Seeder;

Expand All @@ -33,10 +34,13 @@ class AbilitySeeder extends Seeder
*/
public function run()
{
Ability::create([
$ability = Ability::create([
'name' => 'admin: checkin config',
'display_name' => '签到管理',
'description' => '用户是否拥有后台管理签到权限',
]);

$roles = Role::whereIn('name', ['founder'])->get();
$roles->each->abilities()->syncWithoutDetaching([$ability]);
}
}

0 comments on commit 46e7b66

Please sign in to comment.