diff --git a/src/ui/accountSettings/GeneralSettings.tsx b/src/ui/accountSettings/GeneralSettings.tsx index d66df0a..1cb8391 100644 --- a/src/ui/accountSettings/GeneralSettings.tsx +++ b/src/ui/accountSettings/GeneralSettings.tsx @@ -11,7 +11,7 @@ import { snackbar, matAlert } from "../widgets/DialogsProvider"; import { SettingsSection } from "./SettingsSection"; export class GeneralSettings extends React.Component< - { admin: AdminAccount }, + { admin: AdminAccount; editable: boolean }, { newName: string; newEmail: string } > { constructor(p: any) { @@ -66,6 +66,7 @@ export class GeneralSettings extends React.Component< value={this.state.newName} onChange={this.changedName} style={{ width: "100%", paddingBottom: "20px" }} + disabled={!this.props.editable} />
); diff --git a/src/utils/AccountUtils.ts b/src/utils/AccountUtils.ts index 3a9abd3..2c3e49e 100644 --- a/src/utils/AccountUtils.ts +++ b/src/utils/AccountUtils.ts @@ -6,6 +6,10 @@ import { AccountHelper } from "../helpers/AccountHelper"; +export function adminID(): number { + return AccountHelper.currentAccount.id; +} + export function canManageAdmins(): boolean { return AccountHelper.currentAccount.roles.includes("manage_admins"); }