Skip to content

Commit

Permalink
Merge pull request #700 from jwright6/bf-352
Browse files Browse the repository at this point in the history
Fixes Issue #352
  • Loading branch information
andrewelkins committed Dec 29, 2016
2 parents b999584 + 9edcc5e commit 992e484
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Entrust/Traits/EntrustRoleTrait.php
Expand Up @@ -170,7 +170,7 @@ public function attachPermission($permission)
}

if (is_array($permission)) {
$permission = $permission['id'];
return $this->attachPermissions($permission);
}

$this->perms()->attach($permission);
Expand All @@ -185,11 +185,13 @@ public function attachPermission($permission)
*/
public function detachPermission($permission)
{
if (is_object($permission))
if (is_object($permission)) {
$permission = $permission->getKey();
}

if (is_array($permission))
$permission = $permission['id'];
if (is_array($permission)) {
return $this->detachPermissions($permission);
}

$this->perms()->detach($permission);
}
Expand Down

1 comment on commit 992e484

@devsalman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewelkins, its look like the master branch doesn't have the same state as your 5.2 branch. is it ok if i make the master branch has the same state with your current 5.2 branch? when the master branch has the newest update i have a plan to make master branch as an active development branch and we can tag and release the code from the master branch.

Please sign in to comment.