I have created a restriction on a CMS page, but it seems the restriction is totally ignored.
I was able to hide the CMS link component that links to the page via (CMS component restriction) but the page itself is still accessible via the URL.
If it is not supported, how can I restrict some pages to be available for only some users or user groups? is there a way to provide a routing configuration based on user roles?
I'm not sure, if you are still interesting in the answer, but you can feel free to use Spartacus "Guarding Components" approach to handle it.
For example, you can create your own custom guard and link it to certain component from the page, like this:
ConfigModule.withConfig({
cmsComponents: {
CheckoutProgress: {
component: CheckoutProgressComponent,
guards: [AuthGuard, CartNotEmptyGuard],
},
}
});
You can also find out more details here https://sap.github.io/spartacus-docs/customizing-cms-components/#guarding-components.
And as far as I know, Spartacus doesn't work with user's privileges or roles, that's why you should handle this case by self.
P.S. Sorry, I can't open the link from the comment to your post and maybe some other users will be interesting in this answer if you will not.