Open mflash123 opened 6 years ago
@mflash123 This library does not prevent db writing. Can you provide example repository so i can check what you are trying to do.
Happy coding!
Sorry, I dont have examples here. Thanks for answering.
public function index()
{
$this->load->view('welcome_message');
}
public function test()
{
//db writing but it shoudnt because of rbac only view option
$this->Common_m->saveAnything( 'test' ,array("id"=>1) );
}
public function access_map(){
return array(
'index'=>'view',
'test'=>'view'
);
}
So, if rbac doesnt prevent from DB writting, what access_map means? Rbac means only flags in DB for each users and controllers? I mean that only notification/flags and that is not any prevents?
The access code spinet means any user with group that have view permission can access your index and test function. If you want to prevent a use to access the test function but give access to index function You can give the user view permission only and set the access_map like:
public function access_map(){
return array(
'index'=>'view',
'test'=>'write'
);
That means test can access the user who has the write permission.
Happy coding
Please, add any simple example. I made 2 actions and both is view. However both can write to db. Need examples