Exemple #1
0
        public static bool HasPermission(this HtmlHelper helper, PermCode code)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                return(false);
            }
            var userId = System.Web.HttpContext.Current.User.Identity.Name;

            // TODO: 本地权限判断
            return(true);
        }
 public PermissionAttribute(PermCode perm)
 {
     this.Code = (int)perm;
 }
Exemple #3
0
 public static int Code(this PermCode code)
 {
     return((int)code);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="perm"></param>
 /// <param name="tableName"></param>
 public PermissionAttribute(PermCode perm, string tableName = "")
 {
     Code      = perm;
     TableName = tableName;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="perm"></param>
 public PermissionAttribute(PermCode perm)
 {
     Code = perm;
 }