Skip to content

Commit

Permalink
Updated method 'hasPerm' to 'hasPermission' for better consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelldon committed Jul 9, 2015
1 parent 87af3cd commit 23cda54
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Entrust/Traits/EntrustRoleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ public static function boot()
*
* @return bool
*/
public function hasPerm($name, $requireAll = false)
public function hasPermission($name, $requireAll = false)
{
if (is_array($name)) {
foreach ($name as $permName) {
$hasPerm = $this->hasPerm($permName);
foreach ($name as $permissionName) {
$hasPermission = $this->hasPermission($permissionName);

if ($hasPerm && !$requireAll) {
if ($hasPermission && !$requireAll) {
return true;
} elseif (!$hasPerm && $requireAll) {
} elseif (!$hasPermission && $requireAll) {
return false;
}
}
Expand All @@ -80,8 +80,8 @@ public function hasPerm($name, $requireAll = false)
// Return the value of $requireAll;
return $requireAll;
} else {
foreach ($this->perms as $perm) {
if ($perm->name == $name) {
foreach ($this->perms as $permission) {
if ($permission->name == $name) {
return true;
}
}
Expand Down

1 comment on commit 23cda54

@ixperiencenl
Copy link

Choose a reason for hiding this comment

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

Superb, thank a lot! (Y)

Please sign in to comment.