Search in sources :

Example 6 with PolicyEntity

use of org.simbasecurity.core.domain.PolicyEntity in project simba-os by cegeka.

the class RuleDatabaseRepositoryTest method setUp.

@Before
public void setUp() {
    UserEntity user = new UserEntity(USER_NAME);
    RoleEntity role = new RoleEntity(ROLE_NAME);
    policy = new PolicyEntity(POLICY_NAME);
    resourceRuleEntity = new ResourceRuleEntity(RESOURCE_RULE_NAME);
    resourceRuleEntity.setResourceName(RESOURCE_NAME);
    urlRuleEntity = new URLRuleEntity("urlrule");
    persistAndRefresh(user, role, policy, resourceRuleEntity, urlRuleEntity);
    policy.addRule(resourceRuleEntity);
    policy.addRule(urlRuleEntity);
    role.addPolicy(policy);
    user.addRole(role);
}
Also used : RoleEntity(org.simbasecurity.core.domain.RoleEntity) PolicyEntity(org.simbasecurity.core.domain.PolicyEntity) ResourceRuleEntity(org.simbasecurity.core.domain.ResourceRuleEntity) UserEntity(org.simbasecurity.core.domain.UserEntity) URLRuleEntity(org.simbasecurity.core.domain.URLRuleEntity) Before(org.junit.Before)

Aggregations

PolicyEntity (org.simbasecurity.core.domain.PolicyEntity)6 Policy (org.simbasecurity.core.domain.Policy)5 Test (org.junit.Test)3 ResourceRuleEntity (org.simbasecurity.core.domain.ResourceRuleEntity)3 ResourceRule (org.simbasecurity.core.domain.ResourceRule)2 RoleEntity (org.simbasecurity.core.domain.RoleEntity)2 URLRuleEntity (org.simbasecurity.core.domain.URLRuleEntity)2 UserEntity (org.simbasecurity.core.domain.UserEntity)2 PolicyDTO (org.simbasecurity.core.service.manager.dto.PolicyDTO)2 Before (org.junit.Before)1 ValidationException (org.owasp.esapi.errors.ValidationException)1 TPolicy (org.simbasecurity.api.service.thrift.TPolicy)1 Group (org.simbasecurity.core.domain.Group)1 GroupEntity (org.simbasecurity.core.domain.GroupEntity)1 Role (org.simbasecurity.core.domain.Role)1 Rule (org.simbasecurity.core.domain.Rule)1 URLRule (org.simbasecurity.core.domain.URLRule)1 User (org.simbasecurity.core.domain.User)1