static public SealSecurity LoadFromFile(string path, bool ignoreException) { SealSecurity result = null; try { StreamReader sr = new StreamReader(path); XmlSerializer serializer = new XmlSerializer(typeof(SealSecurity)); result = (SealSecurity)serializer.Deserialize(sr); sr.Close(); result.FilePath = path; result.LastModification = File.GetLastWriteTime(path); result.initSecurity(); } catch (Exception ex) { if (!ignoreException) { throw new Exception(string.Format("Unable to read the security file '{0}'.\r\n{1}", path, ex.Message)); } result = new SealSecurity(); result.initSecurity(); } return(result); }
bool _tryAgain = true; //Try again to get rid of Load Assemblies exceptions... public void Authenticate() { Error = ""; Warning = ""; string script = (Security.UseCustomScript && !string.IsNullOrEmpty(Security.Script) ? Security.Script : Security.ProviderScript); try { RazorHelper.CompileExecute(script, this); } catch (Exception ex) { if (_tryAgain) { ex = null; _tryAgain = false; try { RazorHelper.CompileExecute(script, this); } catch (Exception ex2) { ex = ex2; } } if (ex != null) { SecurityGroups.Clear(); Error = ex.Message; } } SealSecurity.AddLoggedUsed(this); }
void setContext(ITypeDescriptorContext context) { _metaConnection = context.Instance as MetaConnection; _metaEnum = context.Instance as MetaEnum; _metaTable = context.Instance as MetaTable; _metaColumn = context.Instance as MetaColumn; _metaJoin = context.Instance as MetaJoin; _reportView = context.Instance as ReportView; _reportOutput = context.Instance as ReportOutput; _reportSchedule = context.Instance as ReportSchedule; _parameter = context.Instance as Parameter; _security = context.Instance as SealSecurity; _emailDevice = context.Instance as OutputEmailDevice; }
public SecurityEditorForm(SealSecurity security) { Visible = false; _security = security; InitializeComponent(); toolStripStatusLabel.Image = null; security.InitEditor(); mainPropertyGrid.ToolbarVisible = false; mainPropertyGrid.SelectedObject = security; mainPropertyGrid.PropertySort = PropertySort.Categorized; mainPropertyGrid.PropertyValueChanged += mainPropertyGrid_PropertyValueChanged; Text = Repository.SealRootProductName + " Security Editor"; ShowIcon = true; Icon = Properties.Resources.serverManager; }
bool _tryAgain = true; //Try again to get rid of Load Assemblies exceptions... /// <summary> /// Authenticate the user using the current security script /// </summary> public void Authenticate() { Error = ""; Warning = ""; string script = (Security.UseCustomScript && !string.IsNullOrEmpty(Security.Script) ? Security.Script : Security.ProviderScript); if (string.IsNullOrEmpty(script)) { throw new Exception("No Security Script to execute. Check the rights to access the repository Security.xml file..."); } try { RazorHelper.CompileExecute(script, this); } catch (Exception ex) { if (_tryAgain) { ex = null; _tryAgain = false; try { RazorHelper.CompileExecute(script, this); } catch (Exception ex2) { ex = ex2; } } if (ex != null) { SecurityGroups.Clear(); Error = ex.Message; } } SealSecurity.AddLoggedUsed(this); }
/// <summary> /// Forces a security reload for Web /// </summary> public void ReloadSecurity() { _security = null; }
public SecurityUser(SealSecurity security) { Security = security; }
/// <summary> /// Logout the user /// </summary> public void Logout() { SecurityGroups.Clear(); SealSecurity.RemoveLoggedUsed(this); }
static public SealSecurity LoadFromFile(string path, bool ignoreException) { SealSecurity result = null; try { StreamReader sr = new StreamReader(path); XmlSerializer serializer = new XmlSerializer(typeof(SealSecurity)); result = (SealSecurity)serializer.Deserialize(sr); sr.Close(); result.FilePath = path; result.LastModification = File.GetLastWriteTime(path); result.initSecurity(); } catch (Exception ex) { if (!ignoreException) throw new Exception(string.Format("Unable to read the security file '{0}'.\r\n{1}", path, ex.Message)); result = new SealSecurity(); result.initSecurity(); } return result; }