Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How can i manage the role and give permission
  • How can i manage the role and give permission using fuelphp framework. for example,
    i want to give read,delete permission to user level and want to give read,edit,delete permission to admin level.
  • in this page you can find many good things!about auth, but i do this, create all users in for example "user" group, then define some roles or use existing roles, such role "user" and "admin" for admin users,
    now you can assign each user to any role.

    then define some permissions in database for example define this:
    area : site
    permission : blog
    actions : read , add , edit , delete

    now you can easily add role_permissions to database , just use role's id and permission'id into data base,

    also you can use "groups" instead of "roles" or assign permissions to user itself,

    you can find all code snippets for creating or assigning in auth and orm documents, and i think you probably will use ormauth for this.
  • and about controlling access to your pages, you can create a base controller for checking uses's permissions in "before" function or simply use \Auth::has_access('...') function for control user's permissions,

    here is a really basic module i have created for my next application using fuelphp, i is really simple :( and realy does not any thing but i have used this method in it, you can see them in main.php controller,

  • thank you Mr.nasserman for your suggestion.but can you direct to me any simple tutorial link?
    i can't easily understand your code because i am beginner.
    Could you teach me please?

  • :) I am beginner too, i don't have link or tutorial page but every think you may need you can find in documents,  if i can, i will write some inline-documents for my code (it is really simple !)
  • :) I am beginner too, i don't have link or tutorial page but every think you may need you can find in documents,  if i can, i will write some inline-documents for my code (it is really simple !)
  • Use Warden Package
  • Hello Mr.Atabak
    how can i use warden package and what i need to know for using warden package.
  • With warden you have role, permission and users table
    You can create role of many permissions
    Create user with role access

Howdy, Stranger!

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

In this Discussion