Replies: 2 comments
-
I want to write this: ' so I tried to include some FIELDS like a 'option' or 'module', 'action' and 'descrtiption' into the table 'permissions', more information and description of the permission shown to the user.' |
Beta Was this translation helpful? Give feedback.
0 replies
-
I did make a PR for this, but it wasn't merged |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I like so much this SW, I began to see if there was a way to put more fiels in the permissions table. I try to explain my view:
In some part of my App, I show the permissions that some User with some kind of Role has, but the values like a 'role.create' not explain all the info, so I tried to include some files like a 'option' or 'module', 'action' and 'descrtiption' into the table 'permissions', more information and description of the permission shown to the user.
So, in laraver-permissions/src/PermissionsRegistrar.php into the function 'loadPermissions()' I wrote this:
...
...
// make the cache smaller using an array with only required fields
return $this->getPermissionClass()->select('id', 'id as i', 'name as n', 'guard_name as g', 'module as m', 'action as a', 'description as d')
->with('roles:id,id as i,name as n,guard_name as g')->get()
->map(function ($permission) {
return $permission->only('i', 'n', 'g', 'm', 'a', 'n') +
['r' => $permission->roles->map->only('i', 'n', 'g', 'm', 'a', 'd')->all()];
})->all();
...
...
But I do not pass by because a problems and error that this modification sent to me. So, my question is: Is there some way to do this? I realy wants to try by my self and make this contribution to this grate software if you are agree with this.
Regards
JP Farber
Beta Was this translation helpful? Give feedback.
All reactions