Skip to content

Commit

Permalink
Merge pull request #190 from BRACKETS-by-TRIAD/impersonal-login-feature
Browse files Browse the repository at this point in the history
added permission for impersonal login to migration
  • Loading branch information
RichardDominik authored Feb 20, 2020
2 parents ef68f39 + 7f6b601 commit 3c10552
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public function __construct()

// ability to upload
'admin.upload',

//ability to impersonal login
'admin.admin-user.impersonal-login'
]);

//Add new permissions
Expand All @@ -92,7 +95,9 @@ public function __construct()
'guard_name' => $this->guardName,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'permissions' => $defaultPermissions,
'permissions' => $defaultPermissions->reject(function ($permission) {
return $permission === 'admin.admin-user.impersonal-login';
}),
],
];

Expand Down Expand Up @@ -156,7 +161,9 @@ public function up(): void
$roleId = $roleItem->id;
}

$permissionItems = DB::table('permissions')->whereIn('name', $permissions)->where(
$permissionItems = DB::table('permissions')
->whereIn('name', $permissions)
->where(
'guard_name',
$role['guard_name']
)->get();
Expand Down

0 comments on commit 3c10552

Please sign in to comment.