A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
search
AI OnAI Off
Hello! I'm implementing a criterion that should determine if a logged in user is of a specific type. Instances of this criterion should then be created as visitor groups. The criterion should include a dropdown that shows the different types a user can belong to. For example if I create a visitor group with the type "Admin", then the pages that has this visitor group will only be viewable by a user that is Admin. I have two problems with this.
1. When I try to create a visitor group with this criterion I get this exception:
"Cannot create an abstract class. MissingMethodException. Unable to load /EPiServer/Cms/VisitorGroups/CriteriaUI status: 500"
I've chekced some tutorials and, this is how I've implemented it, in my settings file, that inherits from CriterionModelBase:
2. If I just create the type property as a string instead and try it out and add my visitor group to a page, IsMatch runs on every page. This seems weird, I believe it should only run on those pages to which I have added the visitor group? Because if I create two visitor groups one "Admin" and one "Normal" based on this criteria, and add those two to two different pages, both visitor groups' IsMatch method is executed when entering the page with the Admin visitor group, which means that the Normal user will get access to an Admin page.
Help appreciated!
Regards, Tobias