feat: club page
wip: edit af request
This commit is contained in:
@@ -63,10 +63,13 @@ public class AffiliationEndpoints {
|
||||
|
||||
@GET
|
||||
@Path("/request/{id}")
|
||||
@RolesAllowed({"federation_admin"})
|
||||
@RolesAllowed({"federation_admin", "club_president", "club_secretaire", "club_respo_intra"})
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Uni<SimpleReqAffiliation> getAffRequest(@PathParam("id") long id) {
|
||||
return service.getRequest(id);
|
||||
return service.getRequest(id).invoke(Unchecked.consumer(o -> {
|
||||
if (o.getClub() == null && !securityIdentity.getRoles().contains("federation_admin"))
|
||||
throw new ForbiddenException();
|
||||
})).invoke(o -> checkPerm.accept(o.getClub()));
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@@ -74,7 +77,11 @@ public class AffiliationEndpoints {
|
||||
@RolesAllowed({"federation_admin"})
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Uni<?> getDelAffRequest(@PathParam("id") long id) {
|
||||
return service.deleteReqAffiliation(id);
|
||||
return service.getRequest(id).invoke(Unchecked.consumer(o -> {
|
||||
if (o.getClub() == null && !securityIdentity.getRoles().contains("federation_admin"))
|
||||
throw new ForbiddenException();
|
||||
})).invoke(o -> checkPerm.accept(o.getClub()))
|
||||
.chain(o -> service.deleteReqAffiliation(id));
|
||||
}
|
||||
|
||||
@PUT
|
||||
@@ -86,6 +93,15 @@ public class AffiliationEndpoints {
|
||||
return service.saveAdmin(form);
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Path("/request/edit")
|
||||
@RolesAllowed({"club_president", "club_secretaire", "club_respo_intra"})
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
public Uni<?> saveEditAffRequest(AffiliationRequestForm form) {
|
||||
return service.saveEdit(form);
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Path("/request/apply")
|
||||
@RolesAllowed({"federation_admin"})
|
||||
|
||||
Reference in New Issue
Block a user