use of org.simbasecurity.core.service.manager.dto.ResourceRuleDTO in project simba-os by cegeka.
the class RuleDTOAssemblerTest method testAssembleSingleRule_ResourceRule.
@Test
public void testAssembleSingleRule_ResourceRule() {
ResourceRule resourceRule = createResourceRule();
ResourceRuleDTO ruleData = (ResourceRuleDTO) RuleDTOAssembler.assemble(resourceRule);
assertNotNull(ruleData);
assertEquals(resourceRule.getName(), ruleData.getName());
assertEquals(resourceRule.getResourceName(), ruleData.getResourceName());
assertEquals(true, ruleData.isCreateAllowed());
assertEquals(true, ruleData.isDeleteAllowed());
assertEquals(true, ruleData.isReadAllowed());
assertEquals(true, ruleData.isWriteAllowed());
assertEquals(0, ruleData.getId());
assertEquals(0, ruleData.getVersion());
}
use of org.simbasecurity.core.service.manager.dto.ResourceRuleDTO in project simba-os by cegeka.
the class RuleDTOAssembler method assemble.
public static RuleDTO assemble(final ResourceRule rule) {
final ResourceRuleDTO ruleDTO = new ResourceRuleDTO();
applyVersionAndId((AbstractVersionedEntity) rule, ruleDTO);
applyRuleDTOAssembling(rule, ruleDTO);
ruleDTO.setCreateAllowed(rule.isCreateAllowed());
ruleDTO.setDeleteAllowed(rule.isDeleteAllowed());
ruleDTO.setReadAllowed(rule.isReadAllowed());
ruleDTO.setWriteAllowed(rule.isWriteAllowed());
return ruleDTO;
}
Aggregations