Permission on Relation Manager

Hello I'm currently using a Filament shield plugin I'm using relation manager on 1 resource i want to include the relation manager to have roles and permission. Can anyone help me please?
17 Replies
christmex
christmex4w ago
sorry but can u please make more explanation on wht are u want to achieve
Fravi
FraviOP4w ago
I need to assign roles and permission to the Relation Manager
christmex
christmex4w ago
you can create policy based on the relation manager model
Fravi
FraviOP4w ago
Is there documentation on how to implement it? sorry Im new to filament shield
toeknee
toeknee4w ago
It's all part of the model, so if they have permission to create or edit a resource model item, then they can edit and create in the relationship
Fravi
FraviOP4w ago
Yes i have a resource with a relationship manager i just want to set a role that can only view the relation Manager in that specific resource and disable the create and edit in the relation manager
toeknee
toeknee4w ago
But you still want them to be able to edit/create in the resource the relation manager is tied too?
Fravi
FraviOP4w ago
If a user role is assigned they can edit so they can view the relation manager but I don't want the user role to create and edit data in the relation manager field
toeknee
toeknee4w ago
Do you understand that they can only do that, if they can edit/delete on the model/resource that the relationship is tied too? If they can create and eidt users and you can edit roles, and your relationship is a users relationship, they will be able to create and edit users within the relationship manager If they cannot create/edit users then they cannot do it in the users relationship either.
Fravi
FraviOP4w ago
just like here only super_admin/admin can only create schedule and lets say instructor/student can only view it, they cannot create/edit and delete.
No description
toeknee
toeknee4w ago
so providing you have the permissions set correctly then they will only be able to view the relationship schedule too.
Fravi
FraviOP4w ago
yes exactly
toeknee
toeknee4w ago
So theres nothing to do specifically for relationships here. Just set the permissions and ensure you have the policies created.
Fravi
FraviOP4w ago
i created policy for schedule which i used for relation schedule and then i cant make it appear in the filament shield
toeknee
toeknee4w ago
You need to sync the permissions with shield
Fravi
FraviOP4w ago
I want to make sure it's clear. I created a schedule policy based on the schedule model, which I used on the relation manager. However, this relation manager doesn't have a resource just inside a parent resource, and I can't make it appear in the shield to assign roles and permissions.
toeknee
toeknee4w ago
Providing the model protected with the policy then it will inherit the permissions.
Want results from more Discord servers?
Add your server