Class AllowAnonymousExtensions
- Namespace
- Cratis.Arc.Authorization
- Assembly
- Cratis.Arc.Core.dll
Extension methods for checking if anonymous access is allowed.
public static class AllowAnonymousExtensions
- Inheritance
-
AllowAnonymousExtensions
- Inherited Members
Methods
IsAnonymousAllowed(MemberInfo)
Checks if anonymous access is allowed for the specified member.
public static bool IsAnonymousAllowed(this MemberInfo member)
Parameters
memberMemberInfoThe member to check for AllowAnonymousAttribute.
Returns
- bool
True if anonymous access is allowed, false otherwise.
Remarks
This method checks the member itself first, then falls back to checking the declaring type. If the member has an explicit [Authorize] attribute without [AllowAnonymous], it will not allow anonymous access.
Exceptions
- AmbiguousAuthorizationLevel
The member has both [Authorize] and [AllowAnonymous] attributes.