⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rulessecuritypermission.cs

📁 nice book for data mining
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Security;
using System.Threading;

namespace Shokr.Security.RuleBasedSecurity
{
    public class RulesSecurityPermission : IPermission
    {

        private string _rule;
        public string Rule
        {
            get
            {
                return this._rule;
            }
            set
            {
                this._rule = value;
            }
        }

        public RulesSecurityPermission(string roleName)
        {
            _rule = roleName;
        }

        void IPermission.Demand()
        {
            if (!SecurityProvider.IsUserInRule(Thread.CurrentPrincipal, Rule))
                throw new SecurityException();
        }

        IPermission IPermission.Copy()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        IPermission IPermission.Intersect(IPermission target)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        bool IPermission.IsSubsetOf(IPermission target)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        IPermission IPermission.Union(IPermission target)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #region ISecurityEncodable Members

        void ISecurityEncodable.FromXml(SecurityElement e)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        SecurityElement ISecurityEncodable.ToXml()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -