• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modules with query functionality?

#2
[eluser]gon[/eluser]
This is possible and not so difficult.

First, you need controllers to check ACL before executing an action. You could write a base controller that checks user rights at the constructor. For doing this, you should write a _remap($action) function that will be called always (see the controllers documentation for this).
This function can access controller name, action and params checking URI segments. Then access DB and check user permissions for controller / action.
All controllers extend will base, so ACL is checked automatically.
Obviously, there should be a module for changing permissions, roles, and so on. Design the after your needs.

Then you can write a helper, something like acl_anchor. You would pass a controller, action and params. The helper would check ACL for this controller / action (using the same library that the controller, DRY) and return a real anchor HTML, or just a greyed text span if the user doesn't have rights to execute that action.

Cheers.


Messages In This Thread
Modules with query functionality? - by El Forum - 06-30-2008, 12:32 PM
Modules with query functionality? - by El Forum - 06-30-2008, 01:19 PM
Modules with query functionality? - by El Forum - 07-01-2008, 12:03 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.