Example #1
0
        /// <summary>
        /// 验证用户是否有执行此操作的权限
        /// </summary>
        /// <param name="user"></param>
        public bool Validate(User user)
        {
            //
            // UNDONE: 未完成验证
            //
            /*
            string _path = Path;
            UserBLL ubll = new UserBLL();

            Operation op = ubll.GetOperation(a => String.Compare(a.Path, _path, true) == 0);

            if (op != null)
            {
                if (!op.Available)
                {
                    OutputPermissionTipHtml("该操作不可用!");
                    return false;
                }
                else
                {
                    UserGroup group = ubll.GetUserGroup((UserGroups)user.GroupID);

                    if (group != null && !Array.Exists(group.Permissions, a => String.Compare(a.Path, _path, true) == 0))
                    {
                        OutputPermissionTipHtml("你所在的用户组无权限执行此操作!如有疑问请联系管理员!");
                        return false;
                    }
                }
            }
             * 
             */
            return true;

        }
Example #2
0
 /// <summary>
 /// 创建用户
 /// </summary>
 /// <param name="user"></param>
 public void CreateUser(User user)
 {
     dal.CreateUser(user.SiteId,user.UserName, EncodePassword(user.Password), user.Name, user.GroupId,user.Available);
 }