use of gov.ca.cwds.security.annotations.Authorize in project perry by ca-cwds.
the class TestServiceImpl method testFilter.
@Override
@Authorize("case:read:caseDTO.caseObject.id")
public List<CaseDTO> testFilter() {
List<CaseDTO> result = new ArrayList<>();
CaseDTO caseDTO = new CaseDTO();
caseDTO.setCaseObject(new Case(1L, "valid"));
result.add(caseDTO);
caseDTO = new CaseDTO();
caseDTO.setCaseObject(new Case(2L, "name"));
result.add(caseDTO);
return result;
}
use of gov.ca.cwds.security.annotations.Authorize in project perry by ca-cwds.
the class AbacMethodInterceptor method checkParametersPermissions.
private void checkParametersPermissions(MethodInvocation methodInvocation) throws ScriptException {
Parameter[] parameters = methodInvocation.getMethod().getParameters();
for (int i = 0; i < parameters.length; i++) {
Authorize authorize = parameters[i].getAnnotation(Authorize.class);
if (authorize != null) {
Object arg = methodInvocation.getArguments()[i];
checkPermissions(authorize, arg);
}
}
}
use of gov.ca.cwds.security.annotations.Authorize in project perry by ca-cwds.
the class TestServiceImpl method testReturnProtectedInstance.
@Override
@Authorize("case:read:caseDTO.caseObject.id")
public CaseDTO testReturnProtectedInstance() {
Case caseObject = new Case(2L, "");
CaseDTO caseDTO = new CaseDTO();
caseDTO.setCaseObject(caseObject);
return caseDTO;
}
use of gov.ca.cwds.security.annotations.Authorize in project perry by ca-cwds.
the class TestServiceImpl method testReturnInstance.
@Override
@Authorize("case:read:caseDTO.caseObject")
public CaseDTO testReturnInstance() {
Case caseObject = new Case(1L, "");
CaseDTO caseDTO = new CaseDTO();
caseDTO.setCaseObject(caseObject);
return caseDTO;
}