Package org.jboss.as.console.client.administration.role.model

Examples of org.jboss.as.console.client.administration.role.model.Role$Key


                        if (standardRoleNames.get(RESULT).isDefined()) {
                            for (ModelNode node : standardRoleNames.get(RESULT).asList()) {
                                StandardRole.add(node.asString());
                            }
                            for (StandardRole standardRole : StandardRole.values()) {
                                roles.add(new Role(standardRole));
                            }
                        }

                        if (!presenter.isStandalone()) {
                            List<ModelNode> hostScopedRoles = stepsResult.get("step-2").get(RESULT).asList();
View Full Code Here


            List<ModelNode> scopeNodes = node.get(scopeName).asList();
            for (ModelNode scopeNode : scopeNodes) {
                scope.add(scopeNode.asString());
            }
            // Use matchId here since the configuration might contain roles in mixed / lower / upper case
            Role scopedRole = new Role(property.getName(), property.getName(), StandardRole.matchId(baseRoleName),
                    type, scope);
            roles.add(scopedRole);
        }
View Full Code Here

        }

        private void addInternalRoleAssignment(final Principals principals, final RoleAssignments assignments,
                final Roles roles, final Property property) {
            String roleId = property.getName();
            Role role = roles.getRole(roleId);
            if (role != null) {
                RoleAssignment.Internal internal = new RoleAssignment.Internal(role);
                ModelNode assignmentNode = property.getValue();
                if (assignmentNode.hasDefined("include-all")) {
                    role.setIncludeAll(assignmentNode.get("include-all").asBoolean());
                }
                if (assignmentNode.hasDefined("include")) {
                    List<Property> inclusions = assignmentNode.get("include").asPropertyList();
                    for (Property inclusion : inclusions) {
                        PrincipalRealmTupel principal = mapPrincipal(principals, inclusion.getName(),
View Full Code Here

    }

    private String rolesCsv(Collection<Role> roles, String prefix) {
        StringBuilder builder = new StringBuilder();
        for (Iterator<Role> iterator = roles.iterator(); iterator.hasNext(); ) {
            Role role = iterator.next();
            builder.append(prefix).append(role.getName());
            if (role.isScoped()) {
                builder.append(" ").append(role.getScope());
            }
            if (iterator.hasNext()) {
                builder.append(", ");
            }
        }
View Full Code Here

            boolean hasExcludes = !roleAssignment.getExcludes().isEmpty();
            List<Role> roles = new ArrayList<Role>(roleAssignment.getRoles());
            RoleComparator comperator = new RoleComparator();
            Collections.sort(roles, comperator);
            for (Iterator<Role> iterator = roles.iterator(); iterator.hasNext(); ) {
                Role role = iterator.next();
                builder.append(roleAsSafeHtml(role, true));
                if (iterator.hasNext() || hasExcludes) {
                    builder.append(SafeHtmlUtils.fromString(", "));
                }
            }
            if (hasExcludes) {
                List<Role> excludes = new ArrayList<Role>(roleAssignment.getExcludes());
                Collections.sort(excludes, comperator);
                for (Iterator<Role> iterator = excludes.iterator(); iterator.hasNext(); ) {
                    Role exclude = iterator.next();
                    builder.append(roleAsSafeHtml(exclude, false));
                    if (iterator.hasNext()) {
                        builder.append(SafeHtmlUtils.fromString(", "));
                    }
                }
View Full Code Here

        form.setFields(nameItem, baseRoleItem, typeItem, scopeItem, includeAllItem);
        form.setEnabled(false);
        form.setToolsCallback(new FormCallback() {
            @Override
            public void onSave(final Map changeSet) {
                Role edited = form.getEditedEntity();
                if (edited != null) {
                    edited.setBaseRole(baseRoleItem.getValue());
                    edited.setScope(scopeItem.getValue());
                    edited.setIncludeAll(includeAllItem.getValue());
                    presenter.saveScopedRole(edited);
                }
            }

            @Override
View Full Code Here

                scopeItem.setChoices(hosts);
            } else if (type == Role.Type.SERVER_GROUP) {
                scopeItem.setChoices(serverGroups);
            }
            // restore selection
            Role entity = form.getEditedEntity();
            if (entity != null) {
                scopeItem.setValue(new ArrayList<String>(entity.getScope()));
            }
        }
    }
View Full Code Here

        form.setFields(nameItem, includeAllItem);
        form.setEnabled(false);
        form.setToolsCallback(new FormCallback() {
            @Override
            public void onSave(final Map changeset) {
                Role edited = form.getEditedEntity();
                if (edited != null) {
                    edited.setIncludeAll(includeAllItem.getValue());
                    presenter.modifyIncludeAll(edited);
                }
            }

            @Override
View Full Code Here

                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            Role scopedRole = new Role(nameItem.getValue(), nameItem.getValue(),
                                    baseRoleItem.getValue(), typeItem.getValue(), scopeItem.getValue());
                            scopedRole.setIncludeAll(includeAllItem.getValue());
                            presenter.addScopedRole(scopedRole);
                        }
                    }
                },
                new ClickHandler() {
View Full Code Here

            scopeItem.setChoices(hosts);
        } else if (type == SERVER_GROUP) {
            scopeItem.setChoices(serverGroups);
        }
        // restore selection
        Role entity = form.getEditedEntity();
        if (entity != null) {
            scopeItem.setValue(new ArrayList<String>(entity.getScope()));
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.administration.role.model.Role$Key

Copyright © 2018 www.massapicom. 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.