Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth Group Driver has_access check
  • Hi,

    I am writting my own auth drivers, and I have some problems with checking the permissions from a group driver.

    The actual code, I am running:
    Auth::group()->has_access('post.read', null);


    This way the group driver should check all logged in driver's all group driver's group, since there is no group given, but it does not.

    Actually I found the reason: Auth_Group_Driver, line 93:
    if ($this instanceof $g_id[0])


    It tries to check for an instance, but the given parameter is only the name of the group driver, since it is from get_groups(). Is it a bug, or I am missing something?


    Thanks,
    Mark
  • Please create a ticket for this at http://github.com/fuel/auth/issues.

    You might have to do some debugging, as Jelmer, who wrote the Auth package, is no longer part of the team, we'll have to dive into it as well, trying to understand why it was implemented this way.
  • I looked at the documentation and if it is correct, it never worked. I also checked this with simpleauth, and it does not work there.
  • I looked at it from every point of view, but I did not find the reason of implementation like this.

    I corrected it to check for the group driver id instead of an instance, and sent a pull request.
  • Don't trust the Auth documentation. I wrote is using "reverse engineering" because Jelmer never documented it. And I might have missed something that only exists in his brain...

  • I checked the comments in the code as well. Are them written by Jelmer? Because the comments confirm that it doesn't return an instance, but a driver_id, and that instanceof operator is the only thing, that expects an instance.
  • Auth was entirely designed by Jelmer, I only made changes/improvements.

    Definitely sounds like a bug then.
  • Actually I checked it on github, this line was written by Dan Horrigan. :D
  • Hmmm.... Looks like he suffered from the same problem as I, trying to figure out what the .... it is meant to do... :-)

Howdy, Stranger!

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

In this Discussion