Package org.jboss.ballroom.client.rbac

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


        super(title, delegate);
        this.title = title;

         // access control
        String nameToken = FRAMEWORK.getPlaceManager().getCurrentPlaceRequest().getNameToken();
        SecurityContext securityContext = SECURITY_SERVICE.getSecurityContext(nameToken);

        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
            /*for(ModelNode item : filteredDMRNames)
            {
                if(item.asString().equals(propBinding.getDetypedName()))
                {
                    filteredJavaNames.add(propBinding.getJavaName());
                    break;
                }
            } */

            // RBAC: read-only attributes
            if(!securityContext.getAttributeWritePriviledge(propBinding.getDetypedName()).isGranted())
                readonlyJavaNames.add(propBinding.getJavaName());



            String[] splitDetypedName = propBinding.getDetypedName().split("/");
View Full Code Here

    }

    @Override
    public SecurityContext getSecurityContext(String id) {

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

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

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

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

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

        boolean outcome = false;

        if(securityService.hasContext(token))
        {
            SecurityContext securityContext = securityService.getSecurityContext(token);
            final AuthorisationDecision readPriviledge = securityContext.getReadPriviledge();
            outcome = readPriviledge.isGranted();

            //notify listeners (error messages, etc)
            Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                @Override
View Full Code Here

        window.center();
    }

    private static Widget createContent() {

        SecurityContext securityContext = Console.MODULES.getSecurityService().getSecurityContext(
                Console.MODULES.getPlaceManager().getCurrentPlaceRequest().getNameToken()
        );

        return new HTML(securityContext.asHtml());
    }
View Full Code Here

    }

    @Override
    public SecurityContext getSecurityContext(String nameToken) {

        SecurityContext securityContext = contextMapping.get(nameToken);
        if(null==securityContext)
            throw new IllegalStateException("Security context should have been created upfront");

        return securityContext;
    }
View Full Code Here

            public void onSuccess(DMRResponse dmrResponse) {

                ModelNode response = dmrResponse.get();
                ModelNode overalResult = response.get(RESULT);

                SecurityContext context = new SecurityContext(nameToken, requiredResources);
                context.setFacet(Facet.valueOf(accessControlReg.getFacet(nameToken).toUpperCase()));

                try {

                    // retrieve access constraints for each required resource and update the security context
                    for(int i=1; i<=steps.size();i++)
                    {
                        String step = "step-"+i;
                        if(overalResult.hasDefined(step))
                        {
                            String resourceAddress = step2address.get(step);
                            ModelNode modelNode = overalResult.get(step).get(RESULT);

                            ModelNode payload = null;
                            if(modelNode.getType() == ModelType.LIST)
                                payload = modelNode.asList().get(0);
                            else
                                payload = modelNode;

                            // break down into root resource and children
                            parseAccessControlChildren(resourceAddress, requiredResources, context, payload);
                        }
                    }

                    context.seal(); // makes it immutable

                    contextMapping.put(nameToken, context);

                    Log.info("Context creation time (" + nameToken + "): " + (System.currentTimeMillis() - start) + "ms");
View Full Code Here

        }
    }

    @Override
    public Widget buildWidget(ResourceAddress address, ResourceDefinition definition) {
        SecurityContext securityContext = Console.MODULES.getSecurityFramework().getSecurityContext(presenter.getProxy().getNameToken());

        final ModelNodeFormBuilder.FormAssets formAssets = new ModelNodeFormBuilder()
                .setConfigOnly()
                .setFields(
                        "annotation-property-replacement",
View Full Code Here

    }

    @Override
    public SecurityContext getSecurityContext(String id) {

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