I came up with the following code to modify permissions for a user on a node :
User u = User.GetCurrent();
string s = u.GetPermissions(Node.GetCurrent().Path);
if (u != null)
{
Document document = new Document(Node.GetCurrent().Id);
Permission.UpdateCruds(u, (umbraco.cms.businesslogic.CMSNode)document, ":FCH");
u.resetNotificationCache();
u.Save();
}
It works as intended, except for the timing.
Apparently, it takes some time (less than a minute) for Umbraco to show the new permissions after this code run.
I thought using "Save()", or "resetNotificationCache()" would help but there is still a delay.
Is there a way to force umbraco to refresh its permissions?
How to refresh permissions programatically
Hello,
I came up with the following code to modify permissions for a user on a node :
is working on a reply...