rsanchez
2017-04-13 84588a793c9484f9182d253ed83ad11687a1d4f8
securis/src/main/java/net/curisit/securis/services/LicenseResource.java
....@@ -49,6 +49,7 @@
4949 import net.curisit.securis.db.Pack;
5050 import net.curisit.securis.db.PackStatus;
5151 import net.curisit.securis.db.User;
52
+import net.curisit.securis.db.User.Rol;
5253 import net.curisit.securis.ioc.EnsureTransaction;
5354 import net.curisit.securis.security.BasicSecurityContext;
5455 import net.curisit.securis.security.Securable;
....@@ -175,7 +176,7 @@
175176 @PUT
176177 @POST
177178 @Path("/{licId}/activate")
178
- @Securable
179
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
179180 @EnsureTransaction
180181 @Consumes(MediaType.APPLICATION_JSON)
181182 @Produces({ MediaType.APPLICATION_JSON })
....@@ -220,7 +221,7 @@
220221 @PUT
221222 @POST
222223 @Path("/{licId}/send")
223
- @Securable
224
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
224225 @EnsureTransaction
225226 @Consumes(MediaType.APPLICATION_JSON)
226227 @Produces({ MediaType.APPLICATION_JSON })
....@@ -274,7 +275,7 @@
274275 @PUT
275276 @POST
276277 @Path("/{licId}/cancel")
277
- @Securable
278
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
278279 @EnsureTransaction
279280 @Consumes(MediaType.APPLICATION_JSON)
280281 @Produces({ MediaType.APPLICATION_JSON })
....@@ -317,7 +318,7 @@
317318 @POST
318319 @Path("/")
319320 @Consumes(MediaType.APPLICATION_JSON)
320
- @Securable
321
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
321322 @Produces({ MediaType.APPLICATION_JSON })
322323 @EnsureTransaction
323324 public Response create(License lic, @Context BasicSecurityContext bsc) throws SeCurisServiceException {
....@@ -456,7 +457,7 @@
456457 @PUT
457458 @POST
458459 @Path("/{licId}")
459
- @Securable
460
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
460461 @EnsureTransaction
461462 @Consumes(MediaType.APPLICATION_JSON)
462463 @Produces({ MediaType.APPLICATION_JSON })
....@@ -506,7 +507,7 @@
506507 @DELETE
507508 @Path("/{licId}")
508509 @EnsureTransaction
509
- @Securable
510
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
510511 @Produces({ MediaType.APPLICATION_JSON })
511512 public Response delete(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException {
512513 LOG.info("Deleting license with id: {}", licId);
....@@ -536,7 +537,7 @@
536537 @POST
537538 @Path("/{licId}/block")
538539 @EnsureTransaction
539
- @Securable
540
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
540541 @Produces({ MediaType.APPLICATION_JSON })
541542 public Response block(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException {
542543 LOG.info("Blocking license with id: {}", licId);
....@@ -567,7 +568,7 @@
567568 @POST
568569 @Path("/{licId}/unblock")
569570 @EnsureTransaction
570
- @Securable
571
+ @Securable(roles = Rol.ADMIN | Rol.ADVANCE)
571572 @Produces({ MediaType.APPLICATION_JSON })
572573 public Response unblock(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException {
573574 LOG.info("Unblocking license with id: {}", licId);