Skip to content

Commit 14b8a78

Browse files
committed
Add Identity.isAnonymous for future use
1 parent d3ccbb3 commit 14b8a78

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/authentication/identity.service.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ export class Identity {
2626
return this.sessionHost.currentIfInCtx;
2727
}
2828

29+
/**
30+
* Is the current requestor anonymous (not logged in)?
31+
*
32+
* Not the best API, use is discouraged.
33+
* Prefer using Auth Policies / {@link Privileges}`.for.can()`
34+
*/
35+
get isAnonymous() {
36+
return this.current.anonymous;
37+
}
38+
2939
/**
3040
* Is the current user an admin?
3141
*

0 commit comments

Comments
 (0)