| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kim.rules.ui; |
| 17 | |
|
| 18 | |
import org.apache.commons.lang.StringUtils; |
| 19 | |
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegation; |
| 20 | |
import org.kuali.rice.kim.rule.event.ui.AddDelegationEvent; |
| 21 | |
import org.kuali.rice.kim.rule.ui.AddDelegationRule; |
| 22 | |
import org.kuali.rice.kns.rules.DocumentRuleBase; |
| 23 | |
import org.kuali.rice.kns.util.GlobalVariables; |
| 24 | |
import org.kuali.rice.kns.util.RiceKeyConstants; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | 0 | public class RoleDocumentDelegationRule extends DocumentRuleBase implements AddDelegationRule { |
| 33 | |
|
| 34 | |
protected static final String ERROR_PATH = "permission.permissionId"; |
| 35 | |
|
| 36 | |
public boolean processAddDelegation(AddDelegationEvent addDelegationEvent) { |
| 37 | 0 | RoleDocumentDelegation newDelegation = addDelegationEvent.getDelegation(); |
| 38 | 0 | boolean rulePassed = true; |
| 39 | 0 | if (newDelegation == null || StringUtils.isBlank(newDelegation.getDelegationTypeCode())) { |
| 40 | 0 | rulePassed = false; |
| 41 | 0 | GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_EMPTY_ENTRY, new String[] {"Permission"}); |
| 42 | |
} |
| 43 | 0 | return rulePassed; |
| 44 | |
} |
| 45 | |
|
| 46 | |
} |