Hi,
I'm refactoring an old DNN module for use in 9.1 and have run into a deprecated section of the codeabase. The legacy code is as follows:
string readRoles;
string writeRoles;
if (ChildDirectory == null)
{
ChildDirectory = new DirectoryInfo(portalSettings.HomeDirectoryMapPath);
ddl.Items.Clear();
System.Web.UI.WebControls.ListItem rootItem = new System.Web.UI.WebControls.ListItem();
rootItem.Text = "Root";
rootItem.Value = String.Empty;
readRoles = DotNetNuke.Common.Utilities.FileSystemUtils.GetRoles("", portalSettings.PortalId, "READ");
writeRoles = DotNetNuke.Common.Utilities.FileSystemUtils.GetRoles("", portalSettings.PortalId, "WRITE");
if ((DotNetNuke.Security.PortalSecurity.IsInRoles(readRoles) || (DotNetNuke.Security.PortalSecurity.IsInRoles(writeRoles))))
{
ddl.Items.Add(rootItem);
}
}
DirectoryInfo currentDir = ChildDirectory;
DirectoryInfo[] childDirs;
string parentFolderName;
parentFolderName = ChildDirectory.FullName.Substring(portalSettings.HomeDirectoryMapPath.Length);
currentDir = ChildDirectory;
childDirs = currentDir.GetDirectories();
You'll notice that readRoles and writeRoles are set to deprecated GetRoles methods. I've researched this and see located FolderPermissionController. I'm unsure whether this is the best approach, and if so, am seeking code samples of how to implement the functionality intended by my old code in the new namespace.
Any help and guidance is much appreciated.
Thanks,
Sid