Search in sources :

Example 1 with PdpAuthorizationService

use of org.kuali.kfs.pdp.service.PdpAuthorizationService in project cu-kfs by CU-CommunityApps.

the class FormatAction method execute.

/**
 * @see org.kuali.kfs.kns.web.struts.action.KualiAction#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    PdpAuthorizationService authorizationService = SpringContext.getBean(PdpAuthorizationService.class);
    Person kualiUser = GlobalVariables.getUserSession().getPerson();
    String methodToCall = findMethodToCall(form, request);
    if (!authorizationService.hasFormatPermission(kualiUser.getPrincipalId())) {
        throw new AuthorizationException(kualiUser.getPrincipalName(), methodToCall, kualiUser.getCampusCode());
    }
    return super.execute(mapping, form, request, response);
}
Also used : AuthorizationException(org.kuali.kfs.krad.exception.AuthorizationException) PdpAuthorizationService(org.kuali.kfs.pdp.service.PdpAuthorizationService) Person(org.kuali.rice.kim.api.identity.Person)

Aggregations

AuthorizationException (org.kuali.kfs.krad.exception.AuthorizationException)1 PdpAuthorizationService (org.kuali.kfs.pdp.service.PdpAuthorizationService)1 Person (org.kuali.rice.kim.api.identity.Person)1