| .. | .. |
|---|
| 49 | 49 | import net.curisit.securis.db.Pack; |
|---|
| 50 | 50 | import net.curisit.securis.db.PackStatus; |
|---|
| 51 | 51 | import net.curisit.securis.db.User; |
|---|
| 52 | +import net.curisit.securis.db.User.Rol; |
|---|
| 52 | 53 | import net.curisit.securis.ioc.EnsureTransaction; |
|---|
| 53 | 54 | import net.curisit.securis.security.BasicSecurityContext; |
|---|
| 54 | 55 | import net.curisit.securis.security.Securable; |
|---|
| .. | .. |
|---|
| 175 | 176 | @PUT |
|---|
| 176 | 177 | @POST |
|---|
| 177 | 178 | @Path("/{licId}/activate") |
|---|
| 178 | | - @Securable |
|---|
| 179 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 179 | 180 | @EnsureTransaction |
|---|
| 180 | 181 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 181 | 182 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| .. | .. |
|---|
| 220 | 221 | @PUT |
|---|
| 221 | 222 | @POST |
|---|
| 222 | 223 | @Path("/{licId}/send") |
|---|
| 223 | | - @Securable |
|---|
| 224 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 224 | 225 | @EnsureTransaction |
|---|
| 225 | 226 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 226 | 227 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| .. | .. |
|---|
| 274 | 275 | @PUT |
|---|
| 275 | 276 | @POST |
|---|
| 276 | 277 | @Path("/{licId}/cancel") |
|---|
| 277 | | - @Securable |
|---|
| 278 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 278 | 279 | @EnsureTransaction |
|---|
| 279 | 280 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 280 | 281 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| .. | .. |
|---|
| 317 | 318 | @POST |
|---|
| 318 | 319 | @Path("/") |
|---|
| 319 | 320 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 320 | | - @Securable |
|---|
| 321 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 321 | 322 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 322 | 323 | @EnsureTransaction |
|---|
| 323 | 324 | public Response create(License lic, @Context BasicSecurityContext bsc) throws SeCurisServiceException { |
|---|
| .. | .. |
|---|
| 456 | 457 | @PUT |
|---|
| 457 | 458 | @POST |
|---|
| 458 | 459 | @Path("/{licId}") |
|---|
| 459 | | - @Securable |
|---|
| 460 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 460 | 461 | @EnsureTransaction |
|---|
| 461 | 462 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 462 | 463 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| .. | .. |
|---|
| 506 | 507 | @DELETE |
|---|
| 507 | 508 | @Path("/{licId}") |
|---|
| 508 | 509 | @EnsureTransaction |
|---|
| 509 | | - @Securable |
|---|
| 510 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 510 | 511 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 511 | 512 | public Response delete(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException { |
|---|
| 512 | 513 | LOG.info("Deleting license with id: {}", licId); |
|---|
| .. | .. |
|---|
| 536 | 537 | @POST |
|---|
| 537 | 538 | @Path("/{licId}/block") |
|---|
| 538 | 539 | @EnsureTransaction |
|---|
| 539 | | - @Securable |
|---|
| 540 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 540 | 541 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 541 | 542 | public Response block(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException { |
|---|
| 542 | 543 | LOG.info("Blocking license with id: {}", licId); |
|---|
| .. | .. |
|---|
| 567 | 568 | @POST |
|---|
| 568 | 569 | @Path("/{licId}/unblock") |
|---|
| 569 | 570 | @EnsureTransaction |
|---|
| 570 | | - @Securable |
|---|
| 571 | + @Securable(roles = Rol.ADMIN | Rol.ADVANCE) |
|---|
| 571 | 572 | @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 572 | 573 | public Response unblock(@PathParam("licId") Integer licId, @Context BasicSecurityContext bsc) throws SeCurisServiceException { |
|---|
| 573 | 574 | LOG.info("Unblocking license with id: {}", licId); |
|---|