Examples of GroupRole


Examples of org.apache.jetspeed.om.security.GroupRole

        try
        {
      for( Iterator roles = JetspeedRoleManagement.getRoles(user.getUserName()); roles.hasNext();)
      {
        GroupRole grouprole = (GroupRole) roles.next();
        String groupname = grouprole.getGroup().getName();
        String rolename = grouprole.getRole().getName();
        if (securityEntry.allowsGroupRole(groupname, rolename, action))
          return true;         
      }

//            for( Iterator roles = JetspeedRoleManagement.getRoles(user.getUserName()); roles.hasNext();)
View Full Code Here

Examples of org.apache.jetspeed.om.security.GroupRole

                    if (groupRoles != null)
                    {
                        while (groupRoles.hasNext())
                        {
                            // note: this is an unordered list. will need to change db schema to order it
                            GroupRole gr = (GroupRole) groupRoles.next();
                            rundata.getParameters().setString( Profiler.PARAM_ROLE, gr.getRole().getName() );
                            profile = fallbackProfile(rundata, cm);
                            if (profile != null)
                            {
                                profiles.add(profile);
                            }
View Full Code Here

Examples of org.apache.jetspeed.om.security.GroupRole

        try
        {
            Iterator roles = service.getRoles("turbine");
            while (roles.hasNext())
            {
              GroupRole gr = (GroupRole) roles.next();
                role = gr.getRole();
                map.put(role.getName(), role);
                System.out.println("role = " + role.getName());
            }
            assertTrue(map.get("user") != null);
            assertTrue(map.get("admin") == null);

            map.clear();
            roles = service.getRoles("admin");           
            while (roles.hasNext())
            {
                GroupRole gr = (GroupRole)roles.next();
                role = gr.getRole();
                map.put(role.getName(), role);
                System.out.println("role = " + role.getName());
            }
            assertTrue(map.get("user") != null);
            assertTrue(map.get("admin") != null);
View Full Code Here

Examples of org.apache.jetspeed.om.security.GroupRole

            for (int ix = 0; ix < rels.size(); ix++)
            {
        TurbineUserGroupRole rel = (TurbineUserGroupRole) rels.get(ix);
        Role role = rel.getTurbineRole();
        Group group = rel.getTurbineGroup();
        GroupRole groupRole = new BaseJetspeedGroupRole();
        groupRole.setGroup(group);
        groupRole.setRole(role);
        roles.put(group.getName() + role.getName(), groupRole);
            }
        }
        catch(Exception e)
        {
View Full Code Here

Examples of org.mifosplatform.portfolio.group.domain.GroupRole

            final Long clientId = command.longValueOfParameterNamed(GroupingTypesApiConstants.clientIdParamName);
            final Client client = this.clientRepository.findOneWithNotFoundDetection(clientId);

            final Group group = this.groupRepository.findOneWithNotFoundDetection(command.getGroupId());
            if (!group.hasClientAsMember(client)) { throw new ClientNotInGroupException(clientId, command.getGroupId()); }
            final GroupRole groupRole = GroupRole.createGroupRole(group, client, role);
            this.groupRoleRepository.save(groupRole);
            return new CommandProcessingResultBuilder().withClientId(client.getId()).withGroupId(group.getId())
                    .withEntityId(groupRole.getId()).build();

        } catch (final DataIntegrityViolationException dve) {
            handleGroupDataIntegrityIssues(command, dve);
            return CommandProcessingResult.empty();
        }
View Full Code Here

Examples of org.mifosplatform.portfolio.group.domain.GroupRole

            this.context.authenticatedUser();
            this.fromApiJsonDeserializer.validateForUpdateRole(command);

            final Group group = this.groupRepository.findOneWithNotFoundDetection(command.getGroupId());

            final GroupRole groupRole = this.groupRoleRepository.findOneWithNotFoundDetection(command.entityId());
            final Map<String, Object> actualChanges = groupRole.update(command);

            if (actualChanges.containsKey(GroupingTypesApiConstants.roleParamName)) {
                final Long newValue = command.longValueOfParameterNamed(GroupingTypesApiConstants.roleParamName);

                CodeValue role = null;
                if (newValue != null) {
                    role = this.codeValueRepository.findOneWithNotFoundDetection(newValue);
                }
                groupRole.updateRole(role);
            }

            if (actualChanges.containsKey(GroupingTypesApiConstants.clientIdParamName)) {
                final Long newValue = command.longValueOfParameterNamed(GroupingTypesApiConstants.clientIdParamName);

                Client client = null;
                if (newValue != null) {
                    client = this.clientRepository.findOneWithNotFoundDetection(newValue);
                    if (!group.hasClientAsMember(client)) { throw new ClientNotInGroupException(newValue, command.getGroupId()); }
                }
                groupRole.updateClient(client);
            }

            this.groupRoleRepository.saveAndFlush(groupRole);
            return new CommandProcessingResultBuilder().with(actualChanges).withGroupId(group.getId()).withEntityId(groupRole.getId())
                    .build();
        } catch (final DataIntegrityViolationException dve) {
            handleGroupDataIntegrityIssues(command, dve);
            return CommandProcessingResult.empty();
        }
View Full Code Here

Examples of org.mifosplatform.portfolio.group.domain.GroupRole

    }

    @Override
    public CommandProcessingResult deleteRole(final Long ruleId) {
        this.context.authenticatedUser();
        final GroupRole groupRole = this.groupRoleRepository.findOneWithNotFoundDetection(ruleId);
        this.groupRoleRepository.delete(groupRole);
        return new CommandProcessingResultBuilder().withEntityId(groupRole.getId()).build();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.