private void Update(ManagedApplication application)
{
m_application = application;
Dictionary<string, SecuredObjectAccessRights> read = new Dictionary<string, SecuredObjectAccessRights>();
Dictionary<string, SecuredObjectAccessRights> write = new Dictionary<string, SecuredObjectAccessRights>();
Dictionary<string, SecuredObjectAccessRights> configure = new Dictionary<string, SecuredObjectAccessRights>();
m_executablePath = application.ExecutablePath;
if (!String.IsNullOrEmpty(m_executablePath))
{
ChangeApplicationPermissionBTN.Enabled = true;
GetAccountAccessRights(m_executablePath, SecuredObject.ExecutableFile, read, write, configure);
string appConfigFile = m_executablePath + ".config";
if (File.Exists(appConfigFile))
{
GetAccountAccessRights(appConfigFile, SecuredObject.DotNetAppConfigFile, read, write, configure);
}
}
m_configurationFile = application.ConfigurationPath;
if (!String.IsNullOrEmpty(m_configurationFile))
{
ChangeApplicationPermissionBTN.Enabled = true;
GetAccountAccessRights(m_configurationFile, SecuredObject.ConfigurationFile, read, write, configure);
}
if (application.Certificate != null)
{
m_privateKeyFilePath = application.Certificate.GetPrivateKeyFilePath();
if (!String.IsNullOrEmpty(m_privateKeyFilePath))
{
GetAccountAccessRights(m_privateKeyFilePath, SecuredObject.PrivateKey, read, write, configure);
}
}
if (application.TrustList != null)
{
if (application.TrustList.StoreType == CertificateStoreType.Directory)
{
m_trustListPath = Utils.GetAbsoluteDirectoryPath(application.TrustList.StorePath, true, false);
if (!String.IsNullOrEmpty(m_trustListPath))
{
ChangeTrustListPermissionBTN.Enabled = true;
GetAccountAccessRights(m_trustListPath, SecuredObject.TrustList, read, write, configure);
}
}
}
ConfigureRightsCTRL.Initialize(configure.Values);
WriteRightsCTRL.Initialize(write.Values);
ReadRightsCTRL.Initialize(read.Values);
}