Vendor Role Permission Serializer
Vendor Role Permissions Serializer
Description
Manages the permissions assigned to vendor roles, linking users, vendors, and roles.
Fields
| Field | Description | Required |
|---|---|---|
user |
User to whom the role is assigned. | Yes |
vendor |
The vendor entity related to the role. | Yes |
assigned_title |
Assigned title of the user within the vendor. | Read-only |
role |
Vendor role(s) assigned to the user. | Yes |
created_by |
Email of the admin who created the role. | Read-only |
is_active |
Indicates if the role is currently active. | Yes |
is_deleted |
Indicates if the role has been deleted. | Yes |
created_at |
Timestamp when the record was created. | Read-only |
updated_at |
Timestamp of the last modification. | Read-only |
Validation
- Ensures that a user cannot have duplicate roles within a vendor.
- Prevents assigning a role to a vendor that already has a role assigned.
Grouped Permissions Representation
The group_permissions method organizes permissions by user, including user details, assigned roles, and metadata.