Skip to content

Commit

Permalink
- Fixed issue where getRoles and getPermissions methods returned empt…
Browse files Browse the repository at this point in the history
…y lists
  • Loading branch information
konovalov-nk committed Nov 28, 2016
1 parent a68bbfe commit 22a95c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Kodeine/Acl/Traits/HasPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function () {
// more permissive permission wins
// if user has multiple roles we keep
// true values.
foreach ($this->roles as $role) {
foreach ($this->roles()->get() as $role) {
foreach ($role->getPermissions() as $slug => $array) {
if ( array_key_exists($slug, $permissions) ) {
foreach ($array as $clearance => $value) {
Expand Down
2 changes: 1 addition & 1 deletion src/Kodeine/Acl/Traits/HasPermissionInheritance.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait HasPermissionInheritance
public function getPermissionsInherited()
{
$rights = [];
$permissions = $this->permissions;
$permissions = $this->permissions()->get();

// ntfs permissions
// determine if ntfs is enabled
Expand Down
2 changes: 1 addition & 1 deletion src/Kodeine/Acl/Traits/HasRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getRoles()
'acl.getRolesById_'.$this->id,
config('acl.cacheMinutes'),
function () {
return $this->roles;
return $this->roles()->get();
}
);

Expand Down

0 comments on commit 22a95c7

Please sign in to comment.