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

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


    public Widget asWidget() {
        principalItem = new ReadOnlyItem<RoleAssignment>("principal", type == Principal.Type.GROUP ? "Group" : "User") {
            @Override
            public String asString() {
                StringBuilder builder = new StringBuilder();
                RoleAssignment assignment = getValue();
                if (assignment != null) {
                    builder.append(assignment.getPrincipal().getName());
                    if (assignment.getRealm() != null) {
                        builder.append("@").append(assignment.getRealm());
                    }
                }
                return builder.toString();
            }
        };
        principalItem.setEnabled(false);
        includeExcludeFormItem = new IncludeExcludeFormItem("n/a", "Roles");

        form.setFields(principalItem, includeExcludeFormItem);
        //        form.setFieldsInGroup(Console.CONSTANTS.common_label_advanced(), new DisclosureGroupRenderer(), excludesItem);
        form.setEnabled(false);
        form.setToolsCallback(new FormCallback() {
            @Override
            public void onSave(final Map changeset) {
                RoleAssignment edited = form.getEditedEntity();
                if (edited != null) {
                    // create a new role assignment to calculate the include / exclude diffs
                    Map<IncludeExcludeFormItem.Type, Set<Role>> includesExcludes = includeExcludeFormItem.getValue();
                    RoleAssignment newRoleAssignment = new RoleAssignment(edited.getPrincipal());
                    newRoleAssignment.setRealm(edited.getRealm());
                    newRoleAssignment.addRoles(includesExcludes.get(INCLUDE));
                    newRoleAssignment.addExcludes(includesExcludes.get(EXCLUDE));
                    presenter.saveRoleAssignment(newRoleAssignment, edited);
                }
            }

            @Override
View Full Code Here


            @Override
            public void onSelectionChange(final SelectionChangeEvent event) {
                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                    @Override
                    public void execute() {
                        RoleAssignment selected = selectionModel.getSelectedObject();
                        updateFormFields(selected);
                    }
                });
            }
        });
View Full Code Here

                            Principal principal = principalItem.getValue();
                            if (realm != null && realm.length() != 0) {
                                principal = new Principal(principal.getId() + "@" + realm, principal.getName(),
                                        principal.getType());
                            }
                            RoleAssignment roleAssignment = new RoleAssignment(principal);
                            roleAssignment.setRealm(realm);
                            if ("Include".equals(includeExcludeItem.getValue())) {
                                roleAssignment.addRoles(rolesItem.getValue());
                            } else if ("Exclude".equals(includeExcludeItem.getValue())) {
                                roleAssignment.addExcludes(rolesItem.getValue());
                            }
                            presenter.addRoleAssignment(roleAssignment);
                        }
                    }
                },
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.administration.role.model.RoleAssignment$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.