/
WebsiteSupport

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

  1. Declare abilities in the manifest. They are merged into abilities.apps, so Settings > Users > Roles, the menu and the route gate all see your app (app/Providers/AddonServiceProvider.php:164-168).
  2. Map your first URL segment to the abilities that open it in segments (:210-227). The app key in abilities.key also makes your URLs close when an admin switches the app off for a company (:186-197).
  3. In every controller action, check again: $user->isAdmin() || $user->hasAbility('<slug>.manage') (app/Addons/Room/Support/RoomAccess.php:18).
  4. Give each menu entry its ability, so users without it never see the entry (app/Addons/Room/addon.php:31).

See also