DocsDeveloper guideBuild an add-on
Rights
Who may see and change your add-on is set by your rights group, your URL segments and checks in your controllers.
1 min read
- Declare
abilitiesin the manifest. They are merged intoabilities.apps, so Settings > Users > Roles, the menu and the route gate all see your app (app/Providers/AddonServiceProvider.php:164-168). - Map your first URL segment to the abilities that open it in
segments(:210-227). The app key inabilities.keyalso makes your URLs close when an admin switches the app off for a company (:186-197). - In every controller action, check again:
$user->isAdmin() || $user->hasAbility('<slug>.manage')(app/Addons/Room/Support/RoomAccess.php:18). - Give each menu entry its
ability, so users without it never see the entry (app/Addons/Room/addon.php:31).