feat: fix org admin permissions (#1822)

This commit is contained in:
XDTD
2023-05-09 00:06:52 +08:00
committed by GitHub
parent 3699177837
commit cb542ae46a
54 changed files with 242 additions and 114 deletions

View File

@ -111,7 +111,7 @@ class ProviderListPage extends BaseListPage {
key: "owner",
width: "150px",
sorter: true,
...this.getColumnSearchProps("owner"),
...this.getColumnSearchProps("organization"),
},
{
title: i18next.t("general:Created time"),
@ -210,6 +210,7 @@ class ProviderListPage extends BaseListPage {
<PopconfirmModal
title={i18next.t("general:Sure to delete") + `: ${record.name} ?`}
onConfirm={() => this.deleteProvider(index)}
disabled={!Setting.isAdminUser(this.props.account) && (record.owner !== this.props.account.owner)}
>
</PopconfirmModal>
</div>
@ -253,7 +254,7 @@ class ProviderListPage extends BaseListPage {
}
this.setState({loading: true});
(Setting.isAdminUser(this.props.account) ? ProviderBackend.getGlobalProviders(params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
: ProviderBackend.getProviders(this.state.owner, params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder))
: ProviderBackend.getProviders(this.props.account.owner, params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder))
.then((res) => {
if (res.status === "ok") {
this.setState({