IO-772 RBAC for RBAC Controls
This commit is contained in:
@@ -28,10 +28,18 @@ function RbacWrapper({
|
||||
...restProps
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
console.log(
|
||||
"********object :>> ",
|
||||
action,
|
||||
rbacDefaults[action],
|
||||
bodyshop.md_rbac[action]
|
||||
);
|
||||
if (
|
||||
(requiredAuthLevel && requiredAuthLevel <= authLevel) ||
|
||||
(bodyshop.md_rbac && bodyshop.md_rbac[action] <= authLevel) ||
|
||||
(!!!bodyshop.md_rbac && rbacDefaults[action] <= authLevel)
|
||||
((bodyshop.md_rbac && bodyshop.md_rbac[action]) || rbacDefaults[action]) <=
|
||||
authLevel ||
|
||||
(!bodyshop.md_rbac && rbacDefaults[action] <= authLevel)
|
||||
)
|
||||
return <div>{React.cloneElement(children, restProps)}</div>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user