コード例 #1
0
 protected void isAuthorized() {
   // check permissions
   boolean userHasPermission = false;
   String permissionName = AwardPermissionConstants.VIEW_AWARD.getAwardPermission();
   userHasPermission =
       getUnitAuthorizationService()
           .hasPermission(
               GlobalVariables.getUserSession().getPrincipalId(), "KC-AWARD", permissionName);
   if (!userHasPermission) {
     permissionName = AwardPermissionConstants.MODIFY_AWARD.getAwardPermission();
     userHasPermission =
         getUnitAuthorizationService()
             .hasPermission(
                 GlobalVariables.getUserSession().getPrincipalId(), "KC-AWARD", permissionName);
   }
   if (!userHasPermission) {
     permissionName = AwardPermissionConstants.MODIFY_AWARD_REPORT_TRACKING.getAwardPermission();
     userHasPermission =
         getUnitAuthorizationService()
             .hasPermission(
                 GlobalVariables.getUserSession().getPrincipalId(), "KC-AWARD", permissionName);
   }
   if (!userHasPermission) {
     throw new AuthorizationException(
         GlobalVariables.getUserSession().getPrincipalName(), "Search", "Report Tracking");
   }
 }
コード例 #2
0
 /**
  * @see org.kuali.kra.award.document.authorizer.AwardAuthorizer#isAuthorized(java.lang.String,
  *     org.kuali.kra.award.document.authorization.AwardTask)
  */
 @Override
 public boolean isAuthorized(String userId, AwardTask task) {
   return !task.getAward().getAwardDocument().isViewOnly()
       && hasPermission(
           userId, task.getAward(), AwardPermissionConstants.MODIFY_AWARD.getAwardPermission());
 }