按业务模块拆分附件权限
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export type AttachmentPermissionAction = "create" | "read" | "delete";
|
||||
|
||||
const ATTACHMENT_PERMISSION_PREFIXES: Record<string, string> = {
|
||||
contract_fee_contract: "fees_contracts_attachments",
|
||||
contract_fee_voucher: "fees_contracts_attachments",
|
||||
contract_fee_invoice: "fees_contracts_attachments",
|
||||
startup_feasibility: "startup_initiation_attachments",
|
||||
startup_ethics: "startup_ethics_attachments",
|
||||
startup_kickoff: "startup_auth_attachments",
|
||||
startup_kickoff_minutes: "startup_auth_attachments",
|
||||
startup_kickoff_signin: "startup_auth_attachments",
|
||||
startup_kickoff_ppt: "startup_auth_attachments",
|
||||
training_authorization: "startup_auth_attachments",
|
||||
drug_shipment: "drug_shipments_attachments",
|
||||
precaution: "precautions_attachments",
|
||||
faq_replies: "faq_attachments",
|
||||
};
|
||||
|
||||
export const getAttachmentPermissionKey = (
|
||||
entityType: string,
|
||||
action: AttachmentPermissionAction
|
||||
): string | null => {
|
||||
const prefix = ATTACHMENT_PERMISSION_PREFIXES[entityType];
|
||||
return prefix ? `${prefix}:${action}` : null;
|
||||
};
|
||||
Reference in New Issue
Block a user