mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 18:41:21 +00:00
feat(rbac): put back condition matcher for workspace permission check and added migration function
This commit is contained in:
@@ -28,11 +28,6 @@ const glob: JsInterpreter<FieldCondition<string>> = (node, object, context) => {
|
||||
const secretPath = context.get(object, node.field);
|
||||
const permissionSecretGlobPath = node.value;
|
||||
if (!secretPath) return false;
|
||||
// console.log(
|
||||
// secretPath,
|
||||
// picomatch.isMatch(secretPath, permissionSecretGlobPath, { strictSlashes: false }),
|
||||
// permissionSecretGlobPath
|
||||
// );
|
||||
return picomatch.isMatch(secretPath, permissionSecretGlobPath, { strictSlashes: false });
|
||||
};
|
||||
|
||||
@@ -102,7 +97,7 @@ export const useGetUserProjectPermissions = ({ workspaceId }: TGetUserProjectPer
|
||||
enabled: Boolean(workspaceId),
|
||||
select: (data) => {
|
||||
const rule = unpackRules<RawRuleOf<MongoAbility<ProjectPermissionSet>>>(data);
|
||||
const ability = createMongoAbility<ProjectPermissionSet>(rule);
|
||||
const ability = createMongoAbility<ProjectPermissionSet>(rule, { conditionsMatcher });
|
||||
return ability;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ export const SecretOverviewPage = () => {
|
||||
const workspaceId = currentWorkspace?._id as string;
|
||||
const { data: latestFileKey } = useGetUserWsKey(workspaceId);
|
||||
const [searchFilter, setSearchFilter] = useState("");
|
||||
const secretPath = router.query?.secretPath as string;
|
||||
const secretPath = (router.query?.secretPath as string) || "/";
|
||||
const permission = useProjectPermission();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user