mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 13:05:44 +00:00
fix rate edit
This commit is contained in:
@@ -446,6 +446,21 @@ export function ruleEngineManageKey(slug: RuleEngineResourceSlug): string {
|
||||
return `edr_freight_app:rule_engine:${slugToResourceKey(slug)}:manage`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deciding a filed change — a step above `manage`, which only lets a staff
|
||||
* member propose one. Only resources with an approval workflow have it.
|
||||
*/
|
||||
export function ruleEngineApproveKey(slug: "rates"): string {
|
||||
return `edr_freight_app:rule_engine:${slugToResourceKey(slug)}:approve`;
|
||||
}
|
||||
|
||||
export function canApproveRuleEngineChange(
|
||||
user: AuthUser | null | undefined,
|
||||
slug: "rates",
|
||||
): boolean {
|
||||
return hasPermission(user, ruleEngineApproveKey(slug));
|
||||
}
|
||||
|
||||
export function canAccessRuleEngineResource(
|
||||
user: AuthUser | null | undefined,
|
||||
slug: RuleEngineResourceSlug,
|
||||
|
||||
Reference in New Issue
Block a user