Search in sources :

Example 6 with RoleActivityRestrictionBO

use of org.mifos.security.rolesandpermission.business.RoleActivityRestrictionBO in project head by mifos.

the class RolesPermissionServiceFacadeWebTier method getActivitiesRestrictionsForCreate.

private List<RoleActivityRestrictionBO> getActivitiesRestrictionsForCreate(List<ActivityRestrictionDto> activityRestrictionDtoList, UserContext userContext) throws PersistenceException {
    List<RoleActivityRestrictionBO> activitiesRestrictions = new ArrayList<RoleActivityRestrictionBO>();
    for (ActivityRestrictionDto activityRestrictionDto : activityRestrictionDtoList) {
        RoleActivityRestrictionBO roleActivityRestrictionBO = new RoleActivityRestrictionBO(userContext);
        ActivityRestrictionTypeEntity activityRestrictionTypeEntity = legacyRolesPermissionsDao.getActivityRestrictionTypeEntity((short) activityRestrictionDto.getActivityRestrictionTypeId());
        roleActivityRestrictionBO.setActivityRestrictionType(activityRestrictionTypeEntity);
        roleActivityRestrictionBO.setRestrictionAmountValue(activityRestrictionDto.getAmountValue());
        activitiesRestrictions.add(roleActivityRestrictionBO);
    }
    return activitiesRestrictions;
}
Also used : ActivityRestrictionTypeEntity(org.mifos.security.rolesandpermission.business.ActivityRestrictionTypeEntity) ArrayList(java.util.ArrayList) ActivityRestrictionDto(org.mifos.dto.domain.ActivityRestrictionDto) RoleActivityRestrictionBO(org.mifos.security.rolesandpermission.business.RoleActivityRestrictionBO)

Aggregations

RoleActivityRestrictionBO (org.mifos.security.rolesandpermission.business.RoleActivityRestrictionBO)6 PersistenceException (org.mifos.framework.exceptions.PersistenceException)5 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 ArrayList (java.util.ArrayList)3 ActivityRestrictionDto (org.mifos.dto.domain.ActivityRestrictionDto)3 RoleBO (org.mifos.security.rolesandpermission.business.RoleBO)3 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)2 ServiceException (org.mifos.framework.exceptions.ServiceException)2 MifosUser (org.mifos.security.MifosUser)2 ActivityEntity (org.mifos.security.rolesandpermission.business.ActivityEntity)2 ActivityRestrictionTypeEntity (org.mifos.security.rolesandpermission.business.ActivityRestrictionTypeEntity)2 UserContext (org.mifos.security.util.UserContext)2 BigDecimal (java.math.BigDecimal)1 HibernateException (org.hibernate.HibernateException)1 ActivityGeneratorException (org.mifos.security.activity.ActivityGeneratorException)1 RolesPermissionsBusinessService (org.mifos.security.rolesandpermission.business.service.RolesPermissionsBusinessService)1 RolesPermissionException (org.mifos.security.rolesandpermission.exceptions.RolesPermissionException)1 BusinessRuleException (org.mifos.service.BusinessRuleException)1