mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 23:55:36 +00:00
fix: permission can not edit admin permission (#5433)
This commit is contained in:
@@ -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'}
|
||||
|
@@ -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) => {
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user