Are there some naming guidelines I should be following when it comes to naming permissions? Right now, everything I find is just along the lines of "Add Foo","Edit Foo","Delete Foo","Add FooBar","Edit FooBar","Delete FooBar", and so forth and so forth.
Keeping in mind that there is no grouping (which is a real pity), and when you have a management screen for all said permissions - the above approach seems quite sloppy.
All your "adds" are together, "edits" are together, etc. eg:
- Add Foo
- Add FooBar
- Add FooBarBez
- Edit Foo
- Edit FooBar
- Edit FooBarBez
- Delete Foo
- Delete FooBar
- Delete FooBarBez
Right now I'm leaning towards something along the lines of what route names look like, for example:
- foo.add
- foo.edit
- foo.delete
- foobar.add
- foobar.edit
- foobar.delete
- foobarbez.add
- foobarbez.edit
- foobarbez.delete
It's more organised in terms of keeping all the 'parent' permissions together (ie: all Foo's together, all FooBar's together, etc). Of course, if there are actual guidelines for this, please do let me know or if you have other valuable input / suggestions?
//Edit Update for Clarity
Specifically,
- __Are__ any naming conventions?
- Are there any preferences in terms of use of singular/plural when it comes to parents (eg: "User Create", "Users Create")
- If parents and action should be separated with a space, a dot, something else? (eg: "users.create"; "users create"; "users->create")
- What about nested resources (Parent.Child)? eg: "users.banking_details.create"
- Captilisation? Lowercase? Camel Case?
As mentioned previously, leaning towards laravel named routes as the guideline so would be: plural, lowercase, separated by dots, including full path (parent+child relationship). Just because thats what I'm leaning towards, doesnt mean its right though, hence me asking for input from the community :)