Example #1
0
 /// <summary>
 /// 当前用户是否具有某项权限值
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="Me"></param>
 /// <param name="right">权限枚举值</param>
 /// <returns></returns>
 public static bool ContainDroit <T>(this Me Me, T right) where T : struct
 {
     Bzure.Security.Permissions.Droit      droit     = new Bzure.Security.Permissions.Droit(right.GetType().FullName);
     Bzure.Security.Permissions.AccessCode droitCode = new Bzure.Security.Permissions.AccessCode(Convert.ToInt32(right));
     droit.AddAccessCode(droitCode);
     return(Me.Authorize(droit));
 }
Example #2
0
File: Droit.cs Project: bzure/BCF
        public IDroit Copy()
        {
            Droit droit = new Droit(this.Guid.ToString());

            foreach (IAccessCode at in this._accessTypes)
            {
                droit.AddAccessCode(at.Copy());
            }
            return(droit);
        }
Example #3
0
File: Droit.cs Project: bzure/BCF
 public IDroit Copy()
 {
     Droit droit = new Droit(this.Guid.ToString());
     foreach (IAccessCode at in this._accessTypes)
         droit.AddAccessCode(at.Copy());
     return droit;
 }