Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Groups and roles
  • I have been trying to recreat the role based authentication used in station.wagon, but i have had no luck. Ive used his common controller and all ofher controllers extend it. I've also created the roles and groups in simpleauth. I havent seen anything else that looks to be needed. , but when i try to go to any page in the site it just errors claiming their are to many redirects. Am i missing a key component? Any help is greatly appreciated
  • The Auth library in itself doesn't do any redirects, so the obvious place to look is in your application. You could have a look at the code in your Depot project on github, which uses Auth for authentication and authorisation. This might give you some pointers as to how to approach this.
  • Thank you for your quick response, I've been looking through fuel depot, it has a different way of passing roles, but hopefully I'll be going it will set me in the right direction.
  • Depot doesn't change anything to the way auth works. I only altered the definition of the roles (or in this case I added a generic role, as the others haven't been added yet). So where you normally would define "location.accesstype" ( like "comments.read", "blogs.edit", etc ), I have a default or generic role called "access.role", which allows me to do
    if (\Auth::has_access('access.staff'))
    {
        // user has staff access
    }
    

    This is basically a workaround for the fact that the SimpleACL driver currently doesn't have a has_role() method which would have accomplished the same thing.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion