Package org.jboss.ballroom.client.rbac

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


        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


        deck = new FormDeckPanel();
        deck.setStyleName("fill-layout-width");

        // RBAC
        SecurityContext securityContext = getSecurityContext();
        boolean writePriviledges = securityContext.getWritePriviledge().isGranted();

        // ----------------------
        // view panel

        VerticalPanel viewPanel = new VerticalPanel();
View Full Code Here

    }

    @Override
    public Set<String> getReadOnlyNames() {
        SecurityService securityFacilities = framework.getSecurityService();
        SecurityContext securityContext = securityFacilities.getSecurityContext();

        if(resourceAddress !=null)
        {
            return securityFacilities.getReadOnlyJavaNames(conversionType, resourceAddress, securityContext);
        }
View Full Code Here

    protected void onAttach() {

        super.onAttach();

        // access control
        SecurityContext securityContext = getSecurityContext();


        // RBAC: operation privileges
        int visibleItemsLeft = checkOperationPrivileges(left, securityContext);
        int visibleItemsRight = checkOperationPrivileges(right, securityContext);
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

    public TextLinkCell(String title, Delegate<T> delegate) {
        super(title, delegate);
        this.title = title;

         // access control
        SecurityContext securityContext = SECURITY_SERVICE.getSecurityContext();

        visible = securityContext.getWritePriviledge().isGranted();
    }
View Full Code Here

        //                actualPayload.get("_filtered-attributes").asList() : Collections.EMPTY_LIST;

        //final Set<String> filteredJavaNames = new HashSet<String>(filteredDMRNames.size());
        //final Set<String> readonlyJavaNames = new HashSet<String>();

        SecurityContext securityContext = getSecurityContext();

        for(PropertyBinding propBinding : beanMetaData.getProperties())
        {

            // RBAC: We need turn the filtered dmr names into java property names to compatible with the ballroom Form API
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

            String first = sockets.iterator().next();
            startLine().appendHtmlConstant("Socket Binding: ").appendEscaped(first).endLine();
            startLine().appendHtmlConstant("Ports: +").appendEscaped(server.getSocketBindings().get(first)).endLine();
        }

        SecurityContext securityContext = findContext("/host=" + host + "/server-config=" + server.getName());
        startLinks(securityContext, false);
        String uniqueServerName = host + "_" + server.getName();
        if (server.isRunning()) {
            appendLifecycleLink(STOP_SERVER_ID + uniqueServerName, null, host, server.getName(), "Stop Server");
            appendLifecycleLink(KILL_SERVER_ID + uniqueServerName, null, host, server.getName(), "Force Shutdown");
View Full Code Here

        appendHtmlConstant("</td>");
        return this;
    }

    SecurityContext findContext(final String resourceAddress) {
        SecurityContext securityContext = SECURITY_SERVICE.getSecurityContext();
        if (securityContext.hasChildContext(resourceAddress)) {
            securityContext = securityContext.getChildContext(resourceAddress);
        }
        return securityContext;
    }
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.