Hi All,
I have programmatically added the view permission to the page but unable remove the view permission from the page.
I am using below code.
PermissionController objPermissionController = new PermissionController();
TabPermissionController objTabPermissionController = new TabPermissionController();
PermissionInfo objViewPermission = (PermissionInfo)objPermissionController.GetPermissionByCodeAndKey("SYSTEM_TAB", "VIEW")[0];
TabPermissionInfo TabViewPermission = new TabPermissionInfo();
TabViewPermission.AllowAccess = false;
TabViewPermission.UserID = int.Parse(dt.Rows[0]["DistributorId"].ToString());
TabViewPermission.RoleID = 19;
TabViewPermission.PermissionID = objViewPermission.PermissionID;
TabViewPermission.TabID = int.Parse(dt.Rows[0]["TabId"].ToString());
objTabPermissionController.AddTabPermission(TabViewPermission);
DataCache.ClearTabsCache(PortalId);
DataCache.ClearTabPermissionsCache(PortalId);
Please help where is the issue.
Thanks,
Avinash Kumar
Mindfire Solutions