mirror of
https://github.com/goauthentik/authentik.git
synced 2026-08-30 18:51:39 -07:00
web: Fix admin interface link appearing.
This commit is contained in:
@@ -89,12 +89,9 @@ export interface SessionMixin {
|
||||
* Whether the user can view the admin innterface.
|
||||
*/
|
||||
export function canAccessAdmin(user?: UserSelf | null) {
|
||||
return (
|
||||
user &&
|
||||
(user.isSuperuser ||
|
||||
user.systemPermissions.includes("access_admin_interface") ||
|
||||
user.pk === 0)
|
||||
);
|
||||
if (!user) return false;
|
||||
|
||||
return !!(user.isSuperuser || user.systemPermissions.includes("access_admin_interface"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -362,7 +362,7 @@ export class LibraryPage extends WithSession(AKElement) {
|
||||
const { currentUser, selectedApp } = this;
|
||||
const { layout, theme, enabledFeatures } = this.uiConfig;
|
||||
|
||||
const editable = currentUser?.isSuperuser && enabledFeatures.applicationEdit;
|
||||
const editable = canAccessAdmin(currentUser) && enabledFeatures.applicationEdit;
|
||||
|
||||
const groupedApps = groupBy(this.visibleApplications, (app) => app.group || "").sort(
|
||||
([groupLabelA, groupAppsA], [groupLabelB, groupAppsB]) => {
|
||||
|
||||
@@ -179,7 +179,7 @@ export class UserSettingsPage extends WithLicenseSummary(WithSession(AKElement))
|
||||
>
|
||||
<div class="pf-c-card">
|
||||
<ak-user-consent-list
|
||||
userId=${ifPresent(currentUser?.pk)}
|
||||
userId=${ifDefined(currentUser?.pk)}
|
||||
></ak-user-consent-list>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user