Answering the two questions:
1. To set permissions on widgets different than the default set of permissions is best to do this using Sitefinity API for permissions
. This is because the default permissions for widgets are rooted in the PageManager class.
To update permissions on a widget refer to the attached UpdatePermissionsOnWidget.zip containing a webform that accepts a title of a page and loops trough all of this page widgets assigning Authors role to have View
permission over the widgets.
Update the above row to specify the rest of permissions available for permission set "Controls
" and grant permissions for different roles.
2. To copy permissions you need a control that is placed and present on a page, permissions can`t be copied from a deleted control.
Referring to the sample attached it is needed to retrieve the control from which to copy and the control to copy to and then use CopyPermissions method available from PageManager class.
var manager = PageManager.GetManager();
manager.CopyPermissions(control1.Permissions, (IList)control2.Permissions, control1.Id, control2.Id);
For the API sample on working with controls on Sitefinity pages please refer to this
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal
and vote to affect the priority of the items