We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 455259a commit b5f96eeCopy full SHA for b5f96ee
lib/user.ts
@@ -1,9 +1,3 @@
1
-/// <reference types="@nextcloud/typings" />
2
-
3
-declare var OC: Nextcloud.v23.OC
4
- | Nextcloud.v24.OC
5
- | Nextcloud.v25.OC;
6
7
const getAttribute = (el: HTMLHeadElement | undefined, attribute: string): string | null => {
8
if (el) {
9
return el.getAttribute(attribute)
@@ -40,7 +34,7 @@ export function getCurrentUser(): NextcloudUser | null {
40
34
currentUser = {
41
35
uid,
42
36
displayName: getAttribute(head, 'data-user-displayname'),
43
- isAdmin: (typeof OC === 'undefined') ? false : OC.isUserAdmin(),
37
+ isAdmin: !!(window as any)._oc_isadmin,
44
38
} as NextcloudUser
45
39
46
return currentUser
0 commit comments