Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ORMAuth users_permission field 'action' format
  • Hello All,

    Maybe my question is too simple for you guys, but I'm still confuse because I cannot find the discussion.

    I want to ask about the action format in table users_permission, I have check some tutorial example is : a:1:{i:0;s:4:"read";} but I still don't understand what is this.

    How to create the action format of : array('add', 'view', 'edit', 'delete')

    Thank you for your help.
  • The permissions table lists all available actions for that permission, in an indexed array format:

    array(
        0 => 'add',
        1 => 'view',
        2 => 'edit',
        3 => 'edlete'
    )

    (which is identical to the format you gave, just with index values for clarity.

    Then in the join table (users_permission, users_role_permission, users_group_permission), you list the indexes of the actions that are applicable for that specific combination.

    Say you have user id #1, and you assign it permission id #6 with that array defined on it, and you want to give user id #1 only "view" access, the join record would contain

    array (1)

    which is the index of the "view" action in the permissions array.

Howdy, Stranger!

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

In this Discussion