CodeIgniter Forums
ACL Filter with Matched Route Name - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: ACL Filter with Matched Route Name (/thread-69894.html)



ACL Filter with Matched Route Name - natanfelles - 01-27-2018

Hello, all!

I'm trying to create an Access Control List using a Controller Filter.

I want to check the permissions based on the Route Name. Because the URI could be updated and this would not affect the Permissions.

I ran the code and did not find a practical way to get the name of the current route (name and not URI).

Any suggestion?



Thank you in advance.


RE: ACL Filter with Matched Route Name - InsiteFX - 01-28-2018

Can you use the url_helpers current_url() method to get what you need?


RE: ACL Filter with Matched Route Name - natanfelles - 01-28-2018

(01-28-2018, 05:30 AM)InsiteFX Wrote: Can you use the url_helpers current_url() method to get what you need?

Hi, InsiteFX. This could be possible, but I was thinking about to can change the uri's without need update all the files.

Then the first thought was about using the Route Name because I'm using the route_to() with named routes to create URL's.

I opened a PR for this. I think can be useful.


RE: ACL Filter with Matched Route Name - InsiteFX - 01-29-2018

I also think that it would be very useful.