Search in sources :

Example 6 with SubjectAclResource

use of org.obiba.mica.security.rest.SubjectAclResource in project mica2 by obiba.

the class DraftHarmonizedDatasetResource method accesses.

@Path("/accesses")
public SubjectAclResource accesses() {
    SubjectAclResource subjectAclResource = applicationContext.getBean(SubjectAclResource.class);
    subjectAclResource.setResourceInstance("/harmonized-dataset", id);
    subjectAclResource.setFileResourceInstance("/file", "/harmonized-dataset/" + id);
    return subjectAclResource;
}
Also used : SubjectAclResource(org.obiba.mica.security.rest.SubjectAclResource) Path(javax.ws.rs.Path)

Example 7 with SubjectAclResource

use of org.obiba.mica.security.rest.SubjectAclResource in project mica2 by obiba.

the class DraftHarmonizedDatasetResource method permissions.

@Path("/permissions")
public SubjectAclResource permissions() {
    SubjectAclResource subjectAclResource = applicationContext.getBean(SubjectAclResource.class);
    subjectAclResource.setResourceInstance("/draft/harmonized-dataset", id);
    subjectAclResource.setFileResourceInstance("/draft/file", "/harmonized-dataset/" + id);
    return subjectAclResource;
}
Also used : SubjectAclResource(org.obiba.mica.security.rest.SubjectAclResource) Path(javax.ws.rs.Path)

Example 8 with SubjectAclResource

use of org.obiba.mica.security.rest.SubjectAclResource in project mica2 by obiba.

the class DataAccessFormResource method permissions.

@Path("/permissions")
@RequiresRoles(Roles.MICA_ADMIN)
public SubjectAclResource permissions() {
    SubjectAclResource subjectAclResource = applicationContext.getBean(SubjectAclResource.class);
    subjectAclResource.setResourceInstance("/data-access-request", "*");
    subjectAclResource.setFileResourceInstance("/file", "/data-access-request");
    return subjectAclResource;
}
Also used : SubjectAclResource(org.obiba.mica.security.rest.SubjectAclResource) Path(javax.ws.rs.Path) RequiresRoles(org.apache.shiro.authz.annotation.RequiresRoles)

Example 9 with SubjectAclResource

use of org.obiba.mica.security.rest.SubjectAclResource in project mica2 by obiba.

the class PermissionAwareResource method permissions.

@Path("/permissions")
@RequiresRoles(Roles.MICA_ADMIN)
default SubjectAclResource permissions() {
    SubjectAclResource subjectAclResource = getApplicationContext().getBean(SubjectAclResource.class);
    subjectAclResource.setResourceInstance(String.format("/draft/%s", getTarget()), "*");
    subjectAclResource.setFileResourceInstance("/draft/file", String.format("/%s", getTarget()));
    return subjectAclResource;
}
Also used : SubjectAclResource(org.obiba.mica.security.rest.SubjectAclResource) Path(javax.ws.rs.Path) RequiresRoles(org.apache.shiro.authz.annotation.RequiresRoles)

Example 10 with SubjectAclResource

use of org.obiba.mica.security.rest.SubjectAclResource in project mica2 by obiba.

the class PermissionAwareResource method accesses.

@Path("/accesses")
@RequiresRoles(Roles.MICA_ADMIN)
default SubjectAclResource accesses() {
    SubjectAclResource subjectAclResource = getApplicationContext().getBean(SubjectAclResource.class);
    subjectAclResource.setResourceInstance(String.format("/%s", getTarget()), "*");
    subjectAclResource.setFileResourceInstance("/file", String.format("/%s", getTarget()));
    return subjectAclResource;
}
Also used : SubjectAclResource(org.obiba.mica.security.rest.SubjectAclResource) Path(javax.ws.rs.Path) RequiresRoles(org.apache.shiro.authz.annotation.RequiresRoles)

Aggregations

SubjectAclResource (org.obiba.mica.security.rest.SubjectAclResource)15 Path (javax.ws.rs.Path)9 RequiresRoles (org.apache.shiro.authz.annotation.RequiresRoles)3