class AccessControlResource extends AlpineResource {

    private static final Logger LOGGER = Logger.getLogger(AccessControlResource.class);

    @GET
    @Path("/team/{uuid}")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Returns the projects assigned to the specified team",
            response = String.class,
            responseContainer = "List",
            responseHeaders = @ResponseHeader(name = TOTAL_COUNT_HEADER, response = Long.class, description = "The total number of projects"),
            notes = "<p>Requires permission <strong>ACCESS_MANAGEMENT</strong></p>"
    )
    @PaginatedApi
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 404, message = "The UUID of the team could not be found"),
    })
    @PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)
    public Response retrieveProjects (@ApiParam(value = "The UUID of the team to retrieve mappings for", format = "uuid", required = true)
                                      @PathParam("uuid") @ValidUuid String uuid,
                                      @ApiParam(value = "Optionally excludes inactive projects from being returned", required = false)
                                      @QueryParam("excludeInactive") boolean excludeInactive,
                                      @ApiParam(value = "Optionally excludes children projects from being returned", required = false)
                                      @QueryParam("onlyRoot") boolean onlyRoot) {
        try (QueryManager qm = new QueryManager(getAlpineRequest())) {
            final Team team = qm.getObjectByUuid(Team.class, uuid);
            if (team != null) {
                final PaginatedResult result = qm.getProjects(team, excludeInactive, true, onlyRoot);
                return Response.ok(result.getObjects()).header(TOTAL_COUNT_HEADER, result.getTotal()).build();
            } else {
                return Response.status(Response.Status.NOT_FOUND).entity("The UUID of the team could not be found.").build();
            }
        }
    }

    @PUT
    @Path("/mapping")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Adds an ACL mapping",
            response = AclMappingRequest.class,
            notes = "<p>Requires permission <strong>ACCESS_MANAGEMENT</strong></p>"
    )
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 404, message = "The UUID of the team or project could not be found"),
            @ApiResponse(code = 409, message = "A mapping with the same team and project already exists")
    })
    @PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)
    public Response addMapping(AclMappingRequest request) {<FILL_FUNCTION_BODY>}

    @DELETE
    @Path("/mapping/team/{teamUuid}/project/{projectUuid}")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Removes an ACL mapping",
            notes = "<p>Requires permission <strong>ACCESS_MANAGEMENT</strong></p>"
    )
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 404, message = "The UUID of the team or project could not be found"),
    })
    @PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)
    public Response deleteMapping(
            @ApiParam(value = "The UUID of the team to delete the mapping for", format = "uuid", required = true)
            @PathParam("teamUuid") @ValidUuid String teamUuid,
            @ApiParam(value = "The UUID of the project to delete the mapping for", format = "uuid", required = true)
            @PathParam("projectUuid") @ValidUuid String projectUuid) {
        try (QueryManager qm = new QueryManager()) {
            final Team team = qm.getObjectByUuid(Team.class, teamUuid);
            final Project project = qm.getObjectByUuid(Project.class, projectUuid);
            if (team != null && project != null) {
                final List<Team> teams = new ArrayList<>();
                for (final Team t: project.getAccessTeams()) {
                    if (t.getUuid() != team.getUuid()) {
                        teams.add(t);
                    }
                }
                project.setAccessTeams(teams);
                qm.persist(project);
                return Response.ok().build();
            } else {
                return Response.status(Response.Status.NOT_FOUND).entity("The UUID of the team or project could not be found.").build();
            }
        }
    }
}

        final Validator validator = super.getValidator();
        failOnValidationError(
                validator.validateProperty(request, "team"),
                validator.validateProperty(request, "project")
        );
        try (QueryManager qm = new QueryManager()) {
            final Team team = qm.getObjectByUuid(Team.class, request.getTeam());
            final Project project = qm.getObjectByUuid(Project.class, request.getProject());
            if (team != null && project != null) {
                for (final Team t: project.getAccessTeams()) {
                   if (t.getUuid() == team.getUuid()) {
                       return Response.status(Response.Status.CONFLICT).entity("A mapping with the same team and project already exists.").build();
                   }
                }
                project.addAccessTeam(team);
                qm.persist(project);
                return Response.ok().build();
            } else {
                return Response.status(Response.Status.NOT_FOUND).entity("The UUID of the team could not be found.").build();
            }
        }
    
<no_super_class>