Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Setting Access Rights per page type

Vote:
 

Is it possible to set access rights directly on a page type somehow? I have a rather big tree of documents which are only shown to users with a given role. However some of those documents are of a certain type and I would like those to be available to Everyone without having to locate them in the tree and setting access rights on them manually.

I am using MVC and I have tried the AllowAnonymous and Authorize(Roles="Everyone") attributes on the controller of that page type, but the EPi access rights seem to override this setting.

Any ideas on how I can accomplish this?

#141781
Nov 20, 2015 9:44
Vote:
 

Here you can read about how to do that, you use the access attribute on your contenttype

http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/9/Content/Attributes/

#141782
Nov 20, 2015 9:48
Vote:
 

That seems to be what I am looking for but I cant get it to work? 

I have put [Access(Roles="Everyone")] on the pagetype and confirmed in the admin UI that the page type now indeed says "Everyone: Create" in access level.

However, I still get redirected to the login page when I attempt to access those pages with a user in the role "Everyone". I tried to add Access=AccessLevel.Read to the attribute but it threw an exception saying only Create is supported (I hope this does not mean that anyone can now create that pagetype on my site...)

On the access rights tab in the admin UI the pages are configured with no read access for the Everyone role, but the documentations says that the Access attribute is applied AFTER this, so that should not be a problem..

Any more hints?

#141786
Nov 20, 2015 10:17
Vote:
 

This attribute controls who shold be able to create/update the content, not viewing the content on the site. For that you set it in the admin interface, read more in the administrator manual:

http://world.episerver.com/globalassets/documents/manuals/episerver-cms/7.5/episerver-7.5-cms-user-guide-for-administrators-print-in-english.pdf

Hope this help

#141790
Nov 20, 2015 10:32
Vote:
 

Maybe I am being particularly dense today but that document seems to contains descriptions on how to set access rights in the tree structure only.

That is not what I am looking for. I want to set access right on a *page type* so that Everyone can read that page regardless of what the rights in the tree structure might be.

The reason I want to do this is that I have a page type that generates indexes of content, and I want the index available to Everyone. These indexes are scattered around in a gigantic tree and I dont want to track them down and set this manually.

#141793
Nov 20, 2015 10:47
Vote:
 

Ok, I do not know if that is possible to do.

Mayby someone else has a better suggestion for you

#141798
Nov 20, 2015 11:22
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.