private void CheckUser(User user)
        {
            IRoleService roleService = new RoleService();
            IConfiguration configuration = ConfigurationService.GetInstance();
            IUserService userService = new UserService();

            ICollection<Role> roles = roleService.GetRolesFromAnUser(user);
            ICollection<Rating> ratings = userService.GetAllRatingsOfAnUser(user);

            bool ok = false;
            foreach (Role role in roles)
                if (role.Name.Equals(Constants.OWNER))
                    ok = true;

            if (!ok)
                throw new AuctionException("User " + user.Email + " does not have the rights to add an auction");

            int nrOfActiveAuctions = this.GetNumberOfActiveAuctionsStartedByUser(user);

            int sum = 0;
            int nr = 0;
            DateTime maxDate = new DateTime(1000, 1, 1);
            foreach (Rating rating in ratings)
            {
                if ((DateTime.Now - rating.Date).TotalDays < configuration.GetValue(Constants.NR_OF_DAYS_USED_TO_DETERMINE_RATING))
                {
                    sum += rating.Grade;
                    nr++;
                    if (rating.Date > maxDate)
                        maxDate = rating.Date;
                }
            }

            double ratingCalc, maxNrOfAuctions;
            if(nr > 0)
            {
                ratingCalc = sum / nr;
                maxNrOfAuctions = ratingCalc / 10 * configuration.GetValue(Constants.MAX_NR_OF_STARTED_AUCTION);
            }
            else
            {
                ratingCalc = 10;
                maxNrOfAuctions = configuration.GetValue(Constants.MAX_NR_OF_STARTED_AUCTION);
            }
            int intMaxNrOfAuctions = (int)maxNrOfAuctions;

            if(ratingCalc < configuration.GetValue(Constants.RATING_THRESH_HOLD_FOR_AUCTION))
            {
                if((DateTime.Now - maxDate).Days >= configuration.GetValue(Constants.NR_OF_DAY_BEFORE_RATING_RESET))
                {
                    for(int i=0;i<ratings.Count;i++)
                    {
                        DataMapperFactoryMethod.GetCurrentFactory().UserFactory.RemoveRating(ratings.ElementAt(i));
                    }
                }
                else
                    throw new AuctionException("Auction can not be added because the rating of the user is small than " + configuration.GetValue(Constants.RATING_THRESH_HOLD_FOR_AUCTION) + "resetare");
            }

            if (nrOfActiveAuctions > intMaxNrOfAuctions)
                throw new AuctionException("Auction can not be added because max number of auctions per user is "+configuration.GetValue(Constants.MAX_NR_OF_STARTED_AUCTION));
        }