public static UserPermission[] FindPermissionsByType(ISession session, UserPermissionTypes type)
 {
     return(session.Query <UserPermission>()
            .Where(p => p.Type == type)
            .OrderBy(p => p.OrderIndex).ThenBy(p => p.Name)
            .ToArray());
 }
Beispiel #2
0
        public static async Task <UserPermissionData[]> FromDBByPermissionTypeAsync(UserPermissionTypes permissionType)
        {
            var query = new DBQuery_User_Permission_Select_By_PermissionType();

            query.IN.PermissionType = permissionType;
            var result = await DBThread.Instance.ReqQueryAsync(query);

            return(query.OUT.Items.ToArray());
        }
Beispiel #3
0
        public static async Task <bool> FromDBAsync(this UserPermissionData item
                                                    , DBKey userId, UserPermissionTypes permissionType)
        {
            var query = new DBQuery_User_Permission_Select();

            query.IN.UserId         = userId;
            query.IN.PermissionType = permissionType;
            var result = await DBThread.Instance.ReqQueryAsync(query);

            var permissionData = query.OUT.Items.Find(permissionType);

            if (permissionData != null)
            {
                permissionData.Copy(item);
                return(true);
            }
            return(false);
        }
 public UserInfo(UserPermissionTypes permission, string name, string password)
 {
     Permission = permission;
     Name = name;
     Password = password;
 }