mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
Fix ACL resource
This commit is contained in:
parent
b7f920f864
commit
8597eac9f9
@ -58,7 +58,7 @@ public class AclResource extends BaseResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate input
|
// Validate input
|
||||||
sourceId = ValidationUtil.validateLength(sourceId, "source", 36, 36, false);
|
ValidationUtil.validateRequired(sourceId, "source");
|
||||||
PermType perm = PermType.valueOf(ValidationUtil.validateLength(permStr, "perm", 1, 30, false));
|
PermType perm = PermType.valueOf(ValidationUtil.validateLength(permStr, "perm", 1, 30, false));
|
||||||
username = ValidationUtil.validateLength(username, "username", 1, 50, false);
|
username = ValidationUtil.validateLength(username, "username", 1, 50, false);
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ public class AclResource extends BaseResource {
|
|||||||
* @throws JSONException
|
* @throws JSONException
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{sourceId: [a-z0-9\\-]+}/{perm: READ|WRITE}/{targetId: [a-z0-9\\-]+}")
|
@Path("{sourceId: [a-z0-9\\-]+}/{perm: [A-Z]+}/{targetId: [a-z0-9\\-]+}")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Response delete(
|
public Response delete(
|
||||||
@PathParam("sourceId") String sourceId,
|
@PathParam("sourceId") String sourceId,
|
||||||
@ -116,9 +116,9 @@ public class AclResource extends BaseResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate input
|
// Validate input
|
||||||
sourceId = ValidationUtil.validateLength(sourceId, "source", 36, 36, false);
|
ValidationUtil.validateRequired(sourceId, "source");
|
||||||
PermType perm = PermType.valueOf(ValidationUtil.validateLength(permStr, "perm", 1, 30, false));
|
PermType perm = PermType.valueOf(ValidationUtil.validateLength(permStr, "perm", 1, 30, false));
|
||||||
targetId = ValidationUtil.validateLength(targetId, "target", 36, 36, false);
|
ValidationUtil.validateRequired(targetId, "target");
|
||||||
|
|
||||||
// Check permission on the source by the principal
|
// Check permission on the source by the principal
|
||||||
AclDao aclDao = new AclDao();
|
AclDao aclDao = new AclDao();
|
||||||
|
Loading…
Reference in New Issue
Block a user