mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: check permission when update user (#1438)
* feat: check permission when update user * feat: check permission when update user * fix: fix organization accountItem modifyRule * fix: fix organization accountItem modifyRule
This commit is contained in:
@ -170,7 +170,7 @@ class AccountTable extends React.Component {
|
||||
}
|
||||
|
||||
let options;
|
||||
if (record.viewRule === "Admin") {
|
||||
if (record.viewRule === "Admin" || record.name === "Is admin" || record.name === "Is global admin") {
|
||||
options = [
|
||||
{id: "Admin", name: "Admin"},
|
||||
{id: "Immutable", name: "Immutable"},
|
||||
|
@ -500,7 +500,7 @@ class UserEditPage extends React.Component {
|
||||
{Setting.getLabel(i18next.t("user:Is admin"), i18next.t("user:Is admin - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={(Setting.isMobile()) ? 22 : 2} >
|
||||
<Switch disabled={this.state.user.owner === "built-in"} checked={this.state.user.isAdmin} onChange={checked => {
|
||||
<Switch disabled={disabled} checked={this.state.user.isAdmin} onChange={checked => {
|
||||
this.updateUserField("isAdmin", checked);
|
||||
}} />
|
||||
</Col>
|
||||
@ -513,7 +513,7 @@ class UserEditPage extends React.Component {
|
||||
{Setting.getLabel(i18next.t("user:Is global admin"), i18next.t("user:Is global admin - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={(Setting.isMobile()) ? 22 : 2} >
|
||||
<Switch disabled={this.state.user.owner === "built-in"} checked={this.state.user.isGlobalAdmin} onChange={checked => {
|
||||
<Switch disabled={disabled} checked={this.state.user.isGlobalAdmin} onChange={checked => {
|
||||
this.updateUserField("isGlobalAdmin", checked);
|
||||
}} />
|
||||
</Col>
|
||||
|
Reference in New Issue
Block a user