Inserting Access - mymagic/open_hub GitHub Wiki

Insert Access

There are some ways to add access into the database

  1. through the backend menu: Site > Sys > Access/Route > Create Access

The Action will populated from the Controller based on the module selected

  1. through the backend menu: Site > Sys > Access/Route > Create Custom Access

You may adding Access manually one by one or you can even create fake action

  1. alternatively, you might want to do it through migration file
public function up()
{
	// Access::setAccessRole('module_name','controller_file',['action1','action2'],['role1','role2']);
	Access::setAccessRole('todo','TodoController',['index','admin'],['admin','developer']);
}

Assign Access to Role

  • after done the above step (#1 or #2) then you should go to Site > Sys > Role > Manage Role to assign the Access to the Role

  • choose & select the action/route you want grant access to that Role