Permissions in a file #1523
lemyskaman
started this conversation in
Ideas
Replies: 4 comments 7 replies
-
It's more familiar to store that kind of files in the |
Beta Was this translation helpful? Give feedback.
3 replies
-
Pls take translation into account, and do we need to cache it for quicker loading? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I've finally came out with a method, which does exactly what I proposed. protected function registerPermissions(Dashboard $dashboard): self
{
collect(File::files(app_path('Permissions')))
->map(function ($file) {
return require_once $file->getPathname();
})
->collapse()
->map(function ($values, $group_name) use ($dashboard) {
foreach ($values as $perm_key => $name) {
$dashboard->registerPermissions(
ItemPermission::group($group_name)
->addPermission(
$perm_key,
__($name)
)
);
}
});
return $this;
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
how display my permission in sreen? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, what you think about putting the orchid permissions in a file or a group of files. To be used by the orchid platform and orchid based apps in a similar fashion of laravel's config files.
So my idea is to allow the OrchidServiceProvider to loop all files within a directory (perhaps we might call it Permissions and put it inside app folder) and in that loop read the multidimensional array inside each file an array that perhaps might look like this:
As you can see in the above array scheme you can specify the group name that wraps the permission keys and inside of it you get the key pair permission/name.
The intention to allow orchid readd multiple files is to separate orchid needed permission that ships already for users roles main and system or examples, from what ever other permissions one might need related to the app
Beta Was this translation helpful? Give feedback.
All reactions