Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsInRole and IsNotInRole should check for null principal/identity #956

Closed
rockfordlhotka opened this issue Oct 10, 2018 · 1 comment
Closed
Assignees

Comments

@rockfordlhotka
Copy link
Member

Is your feature request related to a problem? Please describe.
It is possible (in a .NET Core console app anyway) for the current principal/identity to be null. In this case the IsInRole and IsNotInRole rules throw a null reference exception instead of a security exception.

Describe the solution you'd like
I think the expected behavior is for these rules to throw security exceptions if the principal/identity is null, since the user is clearly not in the required role.

Or actually I suppose IsNotInRole should return true (no exception) because the null user is clearly not in the specified (any) role.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant