Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ormauth issue
  • Hello, I have followed the code for register an permission, save it to group with action, and test it with an user from this group, I can't got working action :

    If I do : \Auth::has_access('admin.list[other]')
    it works because the 'other' action is not in the list, but for \Auth::has_access('admin.list[delete]') it should not access because user group is setup for only list and add actions.

  • You're not testing with the admin user that is created by default? Because that has superadmin access by default, so has_access() already returns true.

    To check the effective permissions, do a Debug::dump() of a Cache::get() of the users permissions. It should return an array with 3 elements: the first being the assigned permissions, the second the revoked permissions, and the third is the superadmin boolean. If that is true, has_access is always true.
  • hey,

    no, no admin or super admin, I created this user based on group 4 (moderator).
    I will dump at office tomorow and will report it, thanks
  • Just setup a test. My user's cache file contains:

      (Array, 3 elements) ↵
         0 (Array, 1 element) ↵
             finance (Array, 1 element) ↵
                 test (Array, 3 elements) ↵
                     0 (String): "view" (4 characters)
                     1 (String): "edit" (4 characters)
                     2 (String): "delete" (6 characters)
         1 (Array, 0 elements)
         2 : null

    so one area ("finance"), one permission ("test"), and three actions. No revokations, and no global access or global ban.




    true, true, false.

    So here it works as it should.
  • I tested on a new app, freshly installed, it worked fine. So issue come from my app.
    When I switched on my 1.7-dev core/package the issue appeared again. So the Auth package was not up to date.

    I dont understand Harro because I always applied this script for my update :

    find "$path_of_core_packages" -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull && echo" \;

    so it doesn't update not well.

    Thanks for all your time and headaches I gave you :P
  • I found its because I have not read the update log when I updated with git pull :

    > Update fuel-1.7
    remote: Counting objects: 30, done.
    remote: Compressing objects: 100% (11/11), done.
    remote: Total 18 (delta 13), reused 11 (delta 6)
    Unpacking objects: 100% (18/18), done.
       7335a61..da8e6cb  1.8/develop -> origin/1.8/develop
    Your configuration specifies to merge with the ref '1.7/develop'
    from the remote, but no such ref was fetched.
    Your configuration specifies to merge with the ref '1.7/develop'
    from the remote, but no such ref was fetched.

    So the fixs was in the final, and it didn't updated the last Auth

Howdy, Stranger!

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

In this Discussion