changed params for set notifications
This commit is contained in:
parent
195d8f1f65
commit
4b50b72ff5
|
@ -144,21 +144,27 @@ public class Notifications {
|
||||||
return Response.status(status).entity(responseBean).build();
|
return Response.status(status).entity(responseBean).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @pathExample /is-user-disabled?username=john.smith
|
||||||
|
* @responseExample application/json { "success": true, "message": null "result": true }
|
||||||
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("is-user-disabled/")
|
@Path("is-user-disabled/")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
/**
|
/**
|
||||||
* Return whether the notifications for this user are enabled or not
|
* Return whether the notifications for this user are enabled or not
|
||||||
* @param username the username you want to check
|
* @param username the username you want to check
|
||||||
* @return true if the notification for the user are disabled (Catalogue and Workspace ones)
|
* @return true if the notification for the user are disabled (Catalogue and Workspace ones)
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@StatusCodes ({
|
@StatusCodes ({
|
||||||
@ResponseCode ( code = 200, condition = "Users with silenced notifications are reported in the 'result' field of the returned object"),
|
@ResponseCode ( code = 200, condition = "true if the notification for the username given as query param are disabled (Catalogue and Workspace ones), false otherwise"),
|
||||||
@ResponseCode ( code = 500, condition = ErrorMessages.ERROR_IN_API_RESULT)
|
@ResponseCode ( code = 500, condition = ErrorMessages.ERROR_IN_API_RESULT)
|
||||||
})
|
})
|
||||||
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
||||||
public Response isUserDisabled(
|
public Response isUserDisabled(
|
||||||
@QueryParam("username") @NotNull(message="username cannot be null") @Size(min=2, message="username cannot be empty")
|
@QueryParam("username") @NotNull(message="username cannot be null")
|
||||||
String username) throws ValidationException{
|
String username) throws ValidationException{
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
|
@ -179,7 +185,7 @@ public class Notifications {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set user notification enabled or disabled
|
* Set user notification enabled or disabled
|
||||||
* @param disable true if you want to disable the notifications for this user
|
* @param disable true if you want to disable the notifications for this user, false if you want to enable them
|
||||||
* @return the result of the operation
|
* @return the result of the operation
|
||||||
* @throws ValidationException
|
* @throws ValidationException
|
||||||
*/
|
*/
|
||||||
|
@ -193,9 +199,9 @@ public class Notifications {
|
||||||
})
|
})
|
||||||
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
||||||
public Response setUserNotifications(
|
public Response setUserNotifications(
|
||||||
@QueryParam("username") @NotNull(message="username cannot be null") @Size(min=2, message="username cannot be empty")
|
@NotNull(message="username cannot be null")
|
||||||
String username,
|
String username,
|
||||||
@QueryParam("disable") @NotNull(message="must specify the disable parameter")
|
@NotNull(message="must specify the disable parameter")
|
||||||
boolean disable) throws ValidationException{
|
boolean disable) throws ValidationException{
|
||||||
|
|
||||||
Caller caller = AuthorizationProvider.instance.get();
|
Caller caller = AuthorizationProvider.instance.get();
|
||||||
|
|
Loading…
Reference in New Issue