当前位置: 首页>>代码示例>>C#>>正文


C# Privilege类代码示例

本文整理汇总了C#中Privilege的典型用法代码示例。如果您正苦于以下问题:C# Privilege类的具体用法?C# Privilege怎么用?C# Privilege使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Privilege类属于命名空间,在下文中一共展示了Privilege类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckPrivilege

 public static void CheckPrivilege(Privilege privilege)
 {
     if (GetCurrentManager() == null)
     {
         HttpContext.Current.Response.Redirect(Globals.GetAdminAbsolutePath("/accessDenied.aspx?privilege=" + privilege.ToString()));
     }
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:7,代码来源:ManagerHelper.cs

示例2: BuildPrivilegeFromDataBaseData

 public static List<TestPrivilege> BuildPrivilegeFromDataBaseData(string idPerson)
 {
     List<TestPrivilege> priveleges = new List<TestPrivilege>();
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string findPriviledge = "SELECT * FROM public.priviledge WHERE id_person = '" + idPerson + "'";
         NpgsqlCommand person = new NpgsqlCommand(findPriviledge, connection);
         using (NpgsqlDataReader contactReader = person.ExecuteReader())
         {
             while (contactReader.Read())
             {
                 //что делать с DateSpecified?
                 Privilege priv = new Privilege();
                 if (contactReader["date_start"] != DBNull.Value)
                     priv.StartDate = Convert.ToDateTime(contactReader["date_start"]);
                 if (contactReader["date_end"] != DBNull.Value)
                     priv.EndDate = Convert.ToDateTime(contactReader["date_end"]);
                 TestPrivilege privilege = new TestPrivilege(priv);
                 if (contactReader["id_priviledge_code"] != DBNull.Value)
                     privilege.privilegeType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(contactReader["id_priviledge_code"]));
                 priveleges.Add(privilege);
             }
         }
     }
     return (priveleges.Count != 0) ? priveleges : null;
 }
开发者ID:nbIxMaN,项目名称:MQTESTS,代码行数:26,代码来源:TestPrivilege.cs

示例3: DbsyncTvPrivilegeType

 public DbsyncTvPrivilegeType(Privilege pr)
 {
     this.priv = pr;
     this.Text = pr.Grantee;
     this.typeOfIcon = GrantIcon;
     this.Name = this.Text;
 }
开发者ID:MartinGmc,项目名称:Database-synchronizator,代码行数:7,代码来源:DbsyncTvPrivilegeType.cs

示例4: Member

 public Member(bnet.protocol.Identity identity, Privilege privs, params Role[] roles)
 {
     this.Identity = identity;
     this.Privileges = privs;
     this.Roles = new List<Role>();
     AddRoles(roles);
 }
开发者ID:Rianon,项目名称:mooege,代码行数:7,代码来源:Member.cs

示例5: InternalPrivilegeEnabler

      public InternalPrivilegeEnabler(Privilege privilegeName)
      {
         if (privilegeName == null)
            throw new ArgumentNullException("privilegeName");

         _mPrivilege = privilegeName;
         AdjustPrivilege(true);
      }
开发者ID:Sicos1977,项目名称:AlphaFS,代码行数:8,代码来源:InternalPrivilegeEnabler.cs

示例6: PrivilegeEnabler

      /// <summary>Initializes a new instance of the <see cref="PrivilegeEnabler"/> class.
      /// This will enable the privileges specified (unless already enabled), and ensure that they are disabled again when
      /// the object is disposed. (Any privileges already enabled will not be disabled).
      /// </summary>
      /// <param name="privilege">The privilege to enable.</param>
      /// <param name="privileges">Additional privileges to enable.</param>
      public PrivilegeEnabler(Privilege privilege, params Privilege[] privileges)
      {
         _enabledPrivileges.Add(new InternalPrivilegeEnabler(privilege));

         if (privileges != null)
            foreach (Privilege priv in privileges)
               _enabledPrivileges.Add(new InternalPrivilegeEnabler(priv));
      }
开发者ID:Sicos1977,项目名称:AlphaFS,代码行数:14,代码来源:PrivilegeEnabler.cs

示例7: GetGrantPrivilegeQuery

 public static string GetGrantPrivilegeQuery(string databaseName, string username, Privilege privilege)
 {
     return string.Format(
         GrantPrivilegeQueryFormat,
         privilege.ToString().ToUpper(),
         databaseName.FormatIdentifier(),
         username.FormatIdentifier()
     );
 }
开发者ID:scottt732,项目名称:influxdb-csharp,代码行数:9,代码来源:Queries.cs

示例8: Member

 public Member(bnet.protocol.Identity identity, Privilege privs)
 {
     this.Identity = identity;
     this.Privileges = privs;
     this.Roles = new List<Role>();
     this.Info = bnet.protocol.AccountInfo.CreateBuilder()
         .SetAccountStatus(bnet.protocol.AccountInfo.Types.AccountStatus.TRIAL)
         .SetCountryId(21843)
         .Build();
 }
开发者ID:cabezotta,项目名称:mooege,代码行数:10,代码来源:Member.cs

示例9: GetRoleByPrivilege

        public Resultat<Role> GetRoleByPrivilege(Privilege privilege)
        {
            return Resultat<Role>.SafeExecute<RoleService>(
                 result =>
                 {
                     int roleId = (int)privilege;

                     var role = context.Roles.Where(r => r.Id == roleId).First<Role>();
                     result.Valeur = role;
                 });
        }
开发者ID:damienpuig,项目名称:SafeDriving,代码行数:11,代码来源:RoleService.cs

示例10: Member

 public Member(bnet.protocol.Identity identity, Privilege privs, params Role[] roles)
 {
     this.Identity = identity;
     this.Privileges = privs;
     this.Roles = new List<Role>();
     AddRoles(roles);
     this.Info = bnet.protocol.AccountInfo.CreateBuilder()
         .SetAccountPaid(true)
         .SetCountryId(21843)
         .Build();
 }
开发者ID:loonbg,项目名称:mooege,代码行数:11,代码来源:Member.cs

示例11: WriteOperationLog

 public static void WriteOperationLog(Privilege privilege, string description)
 {
     OperationLogEntry entry2 = new OperationLogEntry();
     entry2.AddedTime = DateTime.Now;
     entry2.Privilege = privilege;
     entry2.Description = description;
     entry2.IpAddress = Globals.IPAddress;
     entry2.PageUrl = HiContext.Current.Context.Request.RawUrl;
     entry2.UserName = HiContext.Current.Context.User.Identity.Name;
     OperationLogEntry entry = entry2;
     StoreProvider.Instance().WriteOperationLogEntry(entry);
 }
开发者ID:davinx,项目名称:himedi,代码行数:12,代码来源:EventLogs.cs

示例12: WriteOperationLog

 public static void WriteOperationLog(Privilege privilege, string description)
 {
     OperationLogEntry entry = new OperationLogEntry {
         AddedTime = DateTime.Now,
         Privilege = privilege,
         Description = description,
         IpAddress = Globals.IPAddress,
         PageUrl = HttpContext.Current.Request.RawUrl,
         UserName = ManagerHelper.GetCurrentManager().UserName
     };
     new LogDao().WriteOperationLogEntry(entry);
 }
开发者ID:ZhangVic,项目名称:asp1110git,代码行数:12,代码来源:EventLogs.cs

示例13: GetPrivilegeAttributes

        internal static PrivilegeAttributes GetPrivilegeAttributes(Privilege privilege, PrivilegeAndAttributesCollection privileges)
        {
            foreach (PrivilegeAndAttributes privilegeAndAttributes in privileges)
            {
                if (privilegeAndAttributes.Privilege == privilege)
                {
                    return privilegeAndAttributes.PrivilegeAttributes;
                }
            }

            GetLuid(privilege);

            return PrivilegeAttributes.Removed;
        }
开发者ID:alex2015,项目名称:UnitTestApplication,代码行数:14,代码来源:Privileges.cs

示例14: GetInstance

        public static Privilege GetInstance()
        {
            if (_instance == null)
            {
                lock (_syncRoot)
                {
                    if (_instance == null)
                    {
                        _instance = new Privilege();
                    }
                }
            }

            return _instance;
        }
开发者ID:dusdong,项目名称:BaseComponent,代码行数:15,代码来源:Privilege.cs

示例15: EnablePrivilege

        public AdjustPrivilegeResult EnablePrivilege(Privilege privilege)
        {
            lock (SharedPrivileges)
            {
                if (!SharedPrivileges.ContainsKey(privilege) &&
                    _accessTokenHandle.GetPrivilegeState(privilege) == PrivilegeState.Disabled &&
                    _accessTokenHandle.EnablePrivilege(privilege) == AdjustPrivilegeResult.PrivilegeModified)
                {
                    SharedPrivileges.Add(privilege, this);
                    return AdjustPrivilegeResult.PrivilegeModified;
                }

                return AdjustPrivilegeResult.None;
            }
        }
开发者ID:alex2015,项目名称:UnitTestApplication,代码行数:15,代码来源:PrivilegeEnabler.cs


注:本文中的Privilege类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。