Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where getRoles and getPermissions methods returned empty lists #182

Open
wants to merge 1 commit into
base: 1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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