Hi James, I for sure would use the Kentico API because messing in the DB with nodes can be very complicated and mess up your site.
You need to use the SetRolePermissions Method, but an very important note is that it changes the permission for the node where the document inherits the security from. This can be the root for example and that is not what you want. So before you set role permissions first you need to break the inheritance.
Summarized these are the steps you should do:
- Loop through your document ID's
- Get the TreeNode by document ID (DocumentHelper.GetDocument(documentId, TreeProvider))
- Break the inherintance of the document (AclInfoProvider.BreakInherintance(node, bool copyParentPermissions))
- To be sure we delete normally also the permissions (see example code below)
- Get the role info (RoleInfoProvider.GetRoleInfo(RoleCodeName, SiteContext.CurrentSiteName))
Set the role permissions with the
Eaxmple code in Kentico V7 )
// Get ID of ACL used on API Example document
int nodeACLID = ValidationHelper.GetInteger(node.GetValue("NodeACLID"), 0);
if (nodeACLID > 0)
// Delete all ACL items
If this answer helped you, please vote for my answer :-)