voyager icon indicating copy to clipboard operation
voyager copied to clipboard

How Authorize Works in Voyager and add Custom Roles?

Open blpraveen opened this issue 6 months ago • 1 comments

Laravel version

Laravel 9

PHP version

Php version 8

Voyager version

1.4.3

Description of problem

I have customer roles and permission like admin, organizer and customer.

How can add own menu items and data types to organizer and customer?

Proposed solution

Show be able add new roles and own menu and data types . Restrict data by logged in user.

Alternatives considered

No response

Additional context

No response

blpraveen avatar Feb 10 '24 07:02 blpraveen

If I understand right, you might be confused about permissions/roles.
Maybe you meant to say you have roles, "admin, organizer and customer"

Each of those roles can have different permissions for each model. (browse, read, edit, add, delete) You can set these permissions in each role.

The side menu and associated views/actions will only show/work when the authenticated user has a role with browse permissions for the associated model.

See: https://github.com/thedevdojo/voyager/blob/1.6/docs/core-concepts/roles-and-permissions.md

Emerica avatar Feb 10 '24 10:02 Emerica