How to set SupportsClaims=true on Virtual Role in CMS 12

  • Updated
Description

This document Virtual roles mentions "You can add virtual roles to claims by SupportsClaims.  ...If SupportsClaims="false" on the virtual role, virtual roles are only evaluated when you check access rights based on ACLs in CMS. Any principal.IsInRole calls for a virtual role returns false."

The default setting is "false", however, some customers want to set it to "true" but do not know where to set it in CMS 12. 

Solution
It should be set in appsettings.json file as below.
"EpiServer" : { 
"Cms" : { 
"MappedRoles" : { 
"Items" : { 
"your owen virual role name" : { 
"MappedRoles" : [ "WebAdmins", "Administrators" ], 
"SupportsClaims" : "true",
"ShouldMatchAll" : "false" 




}