Inheritance: Seal.Model.RootEditor
コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: HelperEditor.cs プロジェクト: cnark/Seal-Report
 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;
 }
コード例 #4
0
        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;
        }
コード例 #5
0
ファイル: SecurityUser.cs プロジェクト: zyhhb/Seal-Report
        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);
        }
コード例 #6
0
 /// <summary>
 /// Forces a security reload for Web
 /// </summary>
 public void ReloadSecurity()
 {
     _security = null;
 }
コード例 #7
0
 public SecurityUser(SealSecurity security)
 {
     Security = security;
 }
コード例 #8
0
ファイル: SecurityUser.cs プロジェクト: zyhhb/Seal-Report
 /// <summary>
 /// Logout the user
 /// </summary>
 public void Logout()
 {
     SecurityGroups.Clear();
     SealSecurity.RemoveLoggedUsed(this);
 }
コード例 #9
0
ファイル: SecurityUser.cs プロジェクト: cnark/Seal-Report
 public SecurityUser(SealSecurity security)
 {
     Security = security;
 }
コード例 #10
0
ファイル: SealSecurity.cs プロジェクト: cnark/Seal-Report
 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;
 }