class LicenseResource extends AbstractResource {

	@POST
	public Response postLicense(@Auth final DbCredential credential, final License license){
        if(!credential.getRoles().contains(AvailableRoles.DATA_UPDATER)){
            throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
        }

		LOG.info("Got a post license request.");

        //
        // Checks if the data is corrupted, pattern can be compiled etc.
        //
        DataValidator.validate(license);

        // Save the license
        final DbLicense dbLicense = getModelMapper().getDbLicense(license);

        //
        // The store method will deal with making sure there are no pattern conflicts
        // The reason behind this move is the presence of the instance of RepositoryHandler
        // and the imposibility to access that handler from here.
        //
        getLicenseHandler().store(dbLicense);
        cacheUtils.clear(CacheName.PROMOTION_REPORTS);

		return Response.ok().status(HttpStatus.CREATED_201).build();
	}

	public  LicenseResource(final RepositoryHandler repoHandler, final GrapesServerConfig dmConfig);

}