Modify Page Properties using Fluent API

Posted by Community Admin on 03-Aug-2018 13:17

Modify Page Properties using Fluent API

All Replies

Posted by Community Admin on 25-Oct-2010 00:00

Hi I checked the article from this link

http://www.sitefinity.com/40/help/developer-manual/fluent-api-pages-modify-page-properties.html

Is there any way to change the page view permission for specific user through code?

Posted by Community Admin on 25-Oct-2010 00:00

Hi Vanitha,

Below is a sample code that illustrates how to set permissions for a given page.

var pageManager = PageManager.GetManager();
var page = pageManager.GetPageNodes().Where(p => p.Title == "PermissionsTest").SingleOrDefault();
Permission perm = pageManager.CreatePermission(SecurityConstants.Sets.Pages.SetName, page.Id, SecurityManager.GetCurrentUserId());
perm.GrantActions(false, SecurityConstants.Sets.Pages.ChangePermissions);
page.Permissions.Add(perm);
pageManager.SaveChanges();


Regards,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed