NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.16k stars 1.47k forks source link

RequiresRoles for Modules in Nancy 2.x not present #2981

Closed jetic83 closed 4 years ago

jetic83 commented 4 years ago

Prerequisites

Description

Former RequiresClaims(...) could be used for a list of roles of a user. In Nancy 2.x,, this function checks the claims of the Security.ClaimsPrincipal.

However, this ClaimsPrincipal also offers a check for roles directly (user.IsInRole). This property of a user should be leveraged for Nancy Modules: this.requiresRole(string role), or similar.

Steps to Reproduce

System Configuration

khellang commented 4 years ago

Closed by #2982