Package org.jboss.ballroom.client.rbac

Examples of org.jboss.ballroom.client.rbac.SecurityContext


                            }
                        });
            }
        }));

        SecurityContext securityContext = Console.MODULES.getSecurityFramework().getSecurityContext(presenter.getProxy().getNameToken());

        final ModelNodeFormBuilder.FormAssets formAssets = new ModelNodeFormBuilder()
                .setConfigOnly()
                .setResourceDescription(definition)
                .setSecurityContext(securityContext).build();
View Full Code Here


                            }
                        });
            }
        }));

        SecurityContext securityContext = Console.MODULES.getSecurityFramework().getSecurityContext(presenter.getProxy().getNameToken());

        final ModelNodeFormBuilder.FormAssets formAssets = new ModelNodeFormBuilder()
                .setConfigOnly()
                .setResourceDescription(definition)
                .setSecurityContext(securityContext).build();
View Full Code Here

                            }
                        });
            }
        }));

        SecurityContext securityContext = Console.MODULES.getSecurityFramework().getSecurityContext(NameTokens.HttpPresenter);

        final ModelNodeFormBuilder.FormAssets formAssets = new ModelNodeFormBuilder()
                .setConfigOnly()
                .setResourceDescription(definition)
                .setSecurityContext(securityContext).build();
View Full Code Here

    protected void doRevealPlace(final PlaceRequest request, final boolean updateBrowserUrl) {
        Function<ContextCreation> createContext = new Function<ContextCreation>() {
            @Override
            public void execute(final Control<ContextCreation> control) {
                final String nameToken = control.getContext().getRequest().getNameToken();
                final SecurityContext context = securityFramework.getSecurityContext(nameToken);
                if (context == null || (context instanceof ReadOnlyContext)) {
                    // force re-creation if read-only fallback
                    securityFramework.createSecurityContext(nameToken, new AsyncCallback<SecurityContext>() {
                        @Override
                        public void onFailure(Throwable throwable) {
                            control.getContext().setError(throwable);
                            control.abort();
                        }

                        @Override
                        public void onSuccess(SecurityContext securityContext) {
                            control.proceed();
                        }
                    });
                } else {
                    control.proceed();
                }
            }
        };

        Outcome<ContextCreation> outcome = new Outcome<ContextCreation>() {
                    @Override
                    public void onFailure(final ContextCreation context) {
                        unlock();
                        revealDefaultPlace();
                        Console.error("Failed to create security context", context.getError().getMessage());
                    }

                    @Override
                    public void onSuccess(final ContextCreation context) {
                        // unlock(); // remove?
                        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                            @Override
                            public void execute() {
                                final PlaceRequest placeRequest = context.getRequest();
                                DefaultPlaceManager.super.doRevealPlace(placeRequest, updateBrowserUrl);

                                // we only fire LHS highlight events for real sections not top level categories
                                if(updateBrowserUrl) {
                                    /*StringBuffer nameToken = new StringBuffer(placeRequest.getNameToken());
View Full Code Here

        contextAwareWidgets.remove(id);
    }

    @Override
    public void onSecurityContextChanged(final SecurityContextChangedEvent event) {
        SecurityContext context = event.getSecurityContext();
        String addressTemplate = event.getResourceAddress();
       // System.out.println("<SCC>");

        if (context == null) {
            // address resolution
            ModelNode addressNode = AddressMapping.fromString(addressTemplate).asResource(coreGUIContext,
                    event.getWildcards());
            String resourceAddress = normalize(addressNode.get(ADDRESS));
           // System.out.println(
           //         "\tReceiving security context change event for " + addressTemplate + " -> " + resourceAddress);

            // look for child context
            context = getSecurityContext();
            if (context.hasChildContext(resourceAddress)) {
                System.out.println("\tFound child context for " + resourceAddress);
                context = context.getChildContext(resourceAddress);
            }
        }/* else {
            System.out.println("\tReceiving security context change event for " + context);
        }*/

 
View Full Code Here

        supportedHandlers.put("Syslog Handler", syslogHandlerView);

        // filter
        // TODO (hpehl) Right now the security context is 'misused' to get the list of supported handlers. This needs
        // to be replaced once a more MBUI related approach is in place.
        SecurityContext securityContext = securityFramework.getSecurityContext(NameTokens.Logger);
        if (securityContext != null) {
            for (Iterator<Map.Entry<String, AbstractHandlerSubview<?>>> iterator = supportedHandlers.entrySet().iterator(); iterator.hasNext(); ) {
                Map.Entry<String, AbstractHandlerSubview<?>> entry = iterator.next();
                HandlerProducer handlerProducer = entry.getValue();
                String check = "{selected.profile}/subsystem=logging/" + handlerProducer.getManagementModelType() + "=*";
                try {
                    if (!securityContext.getReadPrivilege(check).isGranted()) {
                        iterator.remove();
                    }
                } catch (RuntimeException e) {
                    // The address is not part of the security context -> remove it
                    iterator.remove();
View Full Code Here

        window.center();
    }

    private static Widget createContent() {

        SecurityContext securityContext =
                Console.MODULES.getSecurityFramework().getSecurityContext();

        if(securityContext instanceof SecurityContextImpl)
        {
            return new HTML(((SecurityContextImpl)securityContext).asHtml());
View Full Code Here

     * @param placeRequest the place request
     */
    public void update(final HasHandlers eventSource, final PlaceRequest placeRequest) {
        final String token = placeRequest.getNameToken();
        final String parametrizedToken = tokenFormatter.toPlaceToken(placeRequest);
        final SecurityContext context = lookupContext(placeRequest);
        if (context == null) {
            securityFramework.createSecurityContext(parametrizedToken, accessControlMetaData.getResources(token),
                    accessControlMetaData.isRecursive(token), new AsyncCallback<SecurityContext>() {
                        @Override
                        public void onFailure(final Throwable caught) {
View Full Code Here

        this.presenter = presenter;
    }

    @Override
    public Widget createWidget() {
        SecurityContext securityContext = securityFramework.getSecurityContext(presenter.getProxy().getNameToken());
        batchPanel = new BatchPanel(statementContext, securityContext, presenter);
        threadPoolPanel = new ThreadPoolPanel(statementContext, securityContext, presenter);
        threadFactoriesPanel = new ThreadFactoriesPanel(statementContext, securityContext, presenter);

        DefaultTabLayoutPanel tabs = new DefaultTabLayoutPanel(40, Style.Unit.PX);
View Full Code Here

        startLine().appendEscaped(group.name).endLine();
        if (group.profile != null) {
            startLine().appendEscaped("Profile: " + group.profile).endLine();
        }

        SecurityContext securityContext = findContext("/server-group=" + group.name);
        startLinks(securityContext, true);
        String startId = START_GROUP_ID + group.name;
        String stopId = STOP_GROUP_ID + group.name;
        String restartId = RESTART_GROUP_ID + group.name;
        appendLifecycleLink(startId, group.name, null, null, "Start Group")
View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.rbac.SecurityContext

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.