fix: permission can not edit admin permission (#5433)

This commit is contained in:
Finley Ge
2025-08-11 21:46:27 +08:00
committed by GitHub
parent 5019c6ec8b
commit c6e58291f7
8 changed files with 30 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ function MemberItemCard({
isChecked,
onDelete,
name,
role: permission,
role,
orgs,
addOnly,
rightSlot
@@ -31,7 +31,7 @@ function MemberItemCard({
orgs?: string[];
rightSlot?: React.ReactNode;
}) {
const isAdded = addOnly && !!permission;
const isAdded = addOnly && !!role;
const onChange = () => {
if (!isAdded) _onChange();
};
@@ -61,7 +61,7 @@ function MemberItemCard({
</Box>
<Box lineHeight={1}>{orgs && orgs.length > 0 && <OrgTags orgs={orgs} />}</Box>
</Box>
{!isAdded && permission && <RoleTags permission={permission} />}
{!isAdded && role && <RoleTags permission={role} />}
{isAdded && (
<Tag
mixBlendMode={'multiply'}

View File

@@ -186,12 +186,13 @@ function RoleSelect({
);
})}
<MyDivider />
{roleOptions.checkboxList.length > 0 && (
<Box pb="2" px="3" fontSize={'sm'} color={'myGray.900'}>
{t('common:permission_other')}
</Box>
<>
<MyDivider />
<Box pb="2" px="3" fontSize={'sm'} color={'myGray.900'}>
{t('common:permission_other')}
</Box>
</>
)}
{roleOptions.checkboxList.map((item) => {

View File

@@ -136,6 +136,9 @@ const CollaboratorContextProvider = ({
const Per = new Permission({ role });
const labels: string[] = [];
if (Per.isOwner) {
return [t('common:permission.Owner')];
}
if (Per.hasManagePer) {
labels.push(t(roleList['manage'].name as any));
} else if (Per.hasWritePer) {