• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Authorization RBAC

#1
Hello,
I am just dealing with authorization in a multi-app environment for my project.

Setup is like that my project uses single CI core, one shared folder as a shared app/module and then independent apps that uses that shared app and CI core.

Now I prepared authorization and authentication classes. Authentication is done via a filter so that part is covered, when any request is made, it goes through this filter, but now I need to process authorization (permissions to use apps). I have for each app (exe, read, write, modify, special and full) access permissions to do actions.

1. How do you deal with first access to execute in the controller? Do you put it to initController? In previous, I would use constructor but in CI4 constructor is called before initializing of controller that makes hard to return view (actually it is not possible)

2. How you deal with access denied? Do you use exception such as 404 or simple you call-in function return view with access denied?

Any suggestion for how this could be done in the most logical way? Smile

THX
Reply

#2
I would create a filter for it

See Lonnie's Myth Auth and how he doe's it.

Myth:Auth
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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