Setup Access Control
Access Control is probably the most complicated app to setup up because it has both clientside and serverside components. This documentation shows you how to set up the app only on the serverside (and subsequently how to use the addon on the serverside), but you will need to make sure that you also add the @bennerinformatics/ember-fw-acl
package to your client/package.json
file. Documentation on the clientside aspect of Access Control can be found here.
To set up the serverside aspect of this addon, you will of course, need to follow the generic setup for all addons to install it to the app. If you forgot how to do this, see Setup section of Using Addons in the main docs.
Specific Access Control Setup
Setting up Access Control for the first time and actually using it, are two blended areas of development. In many areas, the way that you must "setup" Access Control, are actually the same ways you will need to continue when adding new resources or permission types anyway. So, for example, the Config documentation covers how to set up your access-control
config (usually covered in Setup) because in Access Control this config is actually dynamic (changing based on the specific resources and permissions you use). Additionally, the Database Migration documentation explains how to properly construct a database migration and setup the database for Access Control, but this must be covered separately because the database will change whenever you update your permissions or add a new resource.
The one piece of setup we can do now is required to setup you Router.php
file. Because the ember-fw-acl
actually is adding permission rules to the database, you actually need to add the routes that it is able to call to the Router. This is fairly simple to do because it just requires using the Access Control Controller, and calling the init function. For example:
//import statement to add underneath the last import statement (referring to RoutingUtils)
use AccessControl\Controller as ACController;
//then add the following line within the mapRoutes() function at the very end
ACController::init($this);
After adding those two lines of code, all of the routes that will be used by ember-fw-acl
to actually add the permissions through the permissions model will be added to the Router, and you shouldn't have any 404 Route Not Found errors.