示例#1
0
        public async Task DearchiveAsync(ManageUserCommand command)
        {
            var user = await _context.Users.FirstOrDefaultAsync(x => x.Id == command.Id);

            if (user == null)
            {
                throw new GfsException(ErrorCode.UserNotFound, _dictionary.UserNotFound);
            }

            user.IsArchival = false;
            await _context.SaveChangesAsync();
        }
示例#2
0
        public async Task RevokeAsync(ManageUserCommand command)
        {
            var user = await _context.Users.FirstOrDefaultAsync(x => x.Id == command.Id);

            if (user == null)
            {
                throw new GfsException(ErrorCode.UserNotFound, _dictionary.UserNotFound);
            }

            user.Permissions = Permissions.Standard;
            await _context.SaveChangesAsync();
        }