Package org.jboss.ballroom.client.rbac

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


    }

    @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


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

        // RBAC
        SecurityContext securityContext = getSecurityContext();
        boolean writePriviledges = this.resourceAddress !=null ?                      // TOOD: Typo in API method
                securityContext.getWritePrivilege(this.resourceAddress).isGranted() :
                securityContext.getWritePriviledge().isGranted();

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

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

    }

    @Override
    public SecurityContext getSecurityContext(String id) {

        SecurityContext securityContext = contextMapping.get(id);
        return securityContext;
    }
View Full Code Here

        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(ContextCreation context) {
                unlock();
                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);
                        eventBus.fireEvent(new LHSHighlightEvent(placeRequest.getNameToken()));
                    }
                });
            }
View Full Code Here

    public boolean canReveal() {
        boolean outcome = false;
        String token = placemanager.getCurrentPlaceRequest().getNameToken();

        if (securityFramework.hasContext(token)) {
            SecurityContext securityContext = securityFramework.getSecurityContext(token);
            final AuthorisationDecision readPrivilege = securityContext.getReadPriviledge();

            // bootstrap operations
            boolean bootstrapRequirementsSatisfied = true;
            for (String op : accessControlMetaData.getOperations(token)) {
                int idx = op.indexOf("#");
                AuthorisationDecision opPrivilege = securityContext.getOperationPriviledge(
                        op.substring(0, idx),
                        op.substring(idx + 1, op.length())
                );

                if (!opPrivilege.isGranted()) {
View Full Code Here

    }

    @Override
    public SecurityContext getSecurityContext(String id) {

        SecurityContext securityContext = contextMapping.get(id);
        return securityContext;
    }
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

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

        // RBAC
        SecurityContext securityContext = getSecurityContext();
        boolean writePriviledges = this.resourceAddress !=null ?                      // TOOD: Typo in API method
                securityContext.getWritePrivilege(this.resourceAddress).isGranted() :
                securityContext.getWritePriviledge().isGranted();

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

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

        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(ContextCreation context) {
                unlock();
                Log.error("Failed to create security context", context.getError());
                Console.error("Failed to create security context", context.getError().getMessage());
            }

            @Override
            public void onSuccess(final ContextCreation context) {
                unlock();

                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                    @Override
                    public void execute() {
                        final PlaceRequest placeRequest = context.getRequest();
                        DefaultPlaceManager.super.doRevealPlace(placeRequest, true);
                        eventBus.fireEvent(
                                new LHSHighlightEvent(placeRequest.getNameToken())
                        );
                    }
View Full Code Here

    HtmlGenerator() {
        this.html = new SafeHtmlBuilder();
        this.lifecycleIds = new ArrayList<String>();

        // access control
        SecurityContext securityContext = SECURITY_SERVICE.getSecurityContext();
        this.writable = securityContext.getWritePriviledge().isGranted();
    }
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.