-
Notifications
You must be signed in to change notification settings - Fork 94
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
added names to routes #80
Conversation
BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly.
Thank you! |
Totally agree - thanks for the PR @iMokhles , all routes should have names, for sure. About your idea of turning route names into "permissions"... There's no other way to put it... I think it's freakin brilliant... 🤯 💥 So simple for both developer and admin, both to understand and to use... Then you'd only need:
And you'd still be able to add new permissions if you want, for things that are within a page or something (don't have a route). Excellent. [Q1] The second one sounds a little tricky, to be able to have a command to import route names as permissions, from a [Q2] How does "Create User" form look, after importing the route names? Are there a lot of permissions then? Does it get very difficult to use? Again, excellent idea. I freakin love it! I think it's the missing piece for a general roles&permissions system. One that would work for 80% of all applications. 🥳 🎈 I mean, if you need roles and permissions, that's probably what you actually need, to restrict people from doing stuff. And doing stuff is usually done with new routes. Brilliant! |
WHOOP-WHOOP! Congrats, your first PR on this repo has officialy been merged.
Again. Thank you for the PR. You are a wonderful person. Keep 'em coming :-) Cheers! |
actually it's start point for my setup,
the only problem here is the getRoutes functions returns only the registered routes, that's means we need to seed the table each time we enable operation inside the CrudController because by default the CrudController enables only:
so other operation's routes won't be registered unless we enable it inside the CrudController. i didn't add any routes permission for creating user form yet, i don't see any need for it ( right now ) but if it's important to use and check permission inside user's creation form i will try to figure out the best way to add it. |
Hmmm... i’m not sure that’ll work well, with a seeder, i think it would be inconvenient when doing continuous deployment. What if you:
That’s why I prefer never to delete something that has an ID and relations. You risk compromising db integrity. So I think a safer approach would be to do the seeding inside a Command (smth like
It’s a relatively small change, but I think it’s one that would improve the reliability of the system A LOT. At least that’s how I would do it, doesn’t mean it’s the only way to do it 😀 If you end up with something you like, please share it here too - would love to give it a go, maybe use it in some of my projects. |
added names to route, it's helpful for my own setup
![Capture d’écran 2020-04-14 à 17 08 55](https://user-images.githubusercontent.com/1247248/79240902-a18d8780-7e72-11ea-9c7d-3e571dfbbbcf.png)
![Capture d’écran 2020-04-14 à 17 09 43](https://user-images.githubusercontent.com/1247248/79240992-bd912900-7e72-11ea-88c4-dec63cdcf8ae.png)
i'm using permissions to determine if user has permission to access routes by names
here's my
checkIfUserIsAdmin
functionand here's my permissions in my database
it's really helpful to allow and disallow access for specific routes
idea from Laravel-Backpack/PermissionManager#203 (comment)