Update MI authz logic

This commit is contained in:
Tuan Dang
2023-11-27 14:19:10 +07:00
parent 99c41bb63b
commit 6579b3c93f
15 changed files with 49 additions and 29 deletions
@@ -31,7 +31,7 @@ export const MachineIdentitySection = withPermission(
machineId
});
createNotification({
text: "Successfully deleted service token v3",
text: "Successfully deleted machine identity",
type: "success"
});
@@ -39,7 +39,7 @@ export const MachineIdentitySection = withPermission(
} catch (err) {
console.error(err);
createNotification({
text: "Failed to delete service token v3",
text: "Failed to delete machine identity",
type: "error"
});
}
@@ -103,13 +103,13 @@ export const MachineIdentityTable = ({
// });
// createNotification({
// text: `Successfully ${isActive ? "enabled" : "disabled"} service token v3`,
// text: `Successfully ${isActive ? "enabled" : "disabled"} machine identity`,
// type: "success"
// });
// } catch (err) {
// console.log(err);
// createNotification({
// text: `Failed to ${isActive ? "enable" : "disable"} service token v3`,
// text: `Failed to ${isActive ? "enable" : "disable"} machine identity`,
// type: "error"
// });
// }
@@ -84,7 +84,7 @@ const SIMPLE_PERMISSION_OPTIONS = [
] as const;
export const OrgRoleModifySection = ({ role, onGoBack }: Props) => {
const isNonEditable = ["owner", "admin", "member"].includes(role?.slug || "");
const isNonEditable = ["owner", "admin", "member", "no-access"].includes(role?.slug || "");
const isNewRole = !role?.slug;
const { createNotification } = useNotificationContext();