Search in sources :

Example 1 with GroupEntity

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

the class GroupDatabaseRepositoryTest method setUp.

@Before
public void setUp() {
    group = new GroupEntity(DUMMY_GROUP_NAME, DUMMY_GROUP_CN);
    group2 = new GroupEntity(DUMMY_GROUP_NAME, "otherCN");
    persistAndRefresh(group, group2);
}
Also used : GroupEntity(org.simbasecurity.core.domain.GroupEntity) Before(org.junit.Before)

Example 2 with GroupEntity

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

the class RuleDatabaseRepositoryTest method setupWithGroups.

private ResourceRule setupWithGroups() {
    User user = new UserEntity(USER_VIA_GROUP);
    Role role = new RoleEntity("role2");
    Group group = new GroupEntity("groupName", "cn");
    Policy policy = new PolicyEntity("policy2");
    ResourceRule resourceRuleEntity = new ResourceRuleEntity("resrule2");
    resourceRuleEntity.setResourceName("resname2");
    urlRuleEntityViaGroup = new URLRuleEntity("urlrule2");
    persistAndRefresh(user, role, policy, resourceRuleEntity, urlRuleEntityViaGroup);
    persistAndRefresh(user, group, role, policy, resourceRuleEntity, urlRuleEntityViaGroup);
    policy.addRule(resourceRuleEntity);
    policy.addRule(urlRuleEntityViaGroup);
    role.addPolicy(policy);
    group.addRole(role);
    user.addGroup(group);
    return resourceRuleEntity;
}
Also used : Role(org.simbasecurity.core.domain.Role) RoleEntity(org.simbasecurity.core.domain.RoleEntity) Policy(org.simbasecurity.core.domain.Policy) Group(org.simbasecurity.core.domain.Group) User(org.simbasecurity.core.domain.User) GroupEntity(org.simbasecurity.core.domain.GroupEntity) PolicyEntity(org.simbasecurity.core.domain.PolicyEntity) ResourceRule(org.simbasecurity.core.domain.ResourceRule) ResourceRuleEntity(org.simbasecurity.core.domain.ResourceRuleEntity) UserEntity(org.simbasecurity.core.domain.UserEntity) URLRuleEntity(org.simbasecurity.core.domain.URLRuleEntity)

Aggregations

GroupEntity (org.simbasecurity.core.domain.GroupEntity)2 Before (org.junit.Before)1 Group (org.simbasecurity.core.domain.Group)1 Policy (org.simbasecurity.core.domain.Policy)1 PolicyEntity (org.simbasecurity.core.domain.PolicyEntity)1 ResourceRule (org.simbasecurity.core.domain.ResourceRule)1 ResourceRuleEntity (org.simbasecurity.core.domain.ResourceRuleEntity)1 Role (org.simbasecurity.core.domain.Role)1 RoleEntity (org.simbasecurity.core.domain.RoleEntity)1 URLRuleEntity (org.simbasecurity.core.domain.URLRuleEntity)1 User (org.simbasecurity.core.domain.User)1 UserEntity (org.simbasecurity.core.domain.UserEntity)1