Package org.jdesktop.wonderland.server.security

Examples of org.jdesktop.wonderland.server.security.ResourceMap


     */
    public void generateLoadMessagesService(Collection<CellDescription> cells) {
        // check if this user has permission to view the cells in this
        // collection, and then generate load messages for any that we
        // do have permission for
        ResourceMap rm = new ResourceMap();
      
        // a map of all the cells. The cells that we don't have permission
        // to see wil be removed by the LoadCellsTask below.
        // OWL issue #95: this map must maintain the ordering of the original
        // set in order to guarantee that parent cells are loaded before their
View Full Code Here


     */
    public void revalidateCellsService(Collection<CellDescription> cells) {
        // check if this user has permission to view the cells in this
        // collection, and then generate load messages for any that we
        // do have permission for
        ResourceMap rm = new ResourceMap();

        // cells we need to check for permission
        // OWL issue #95: this map must maintain the ordering of the original
        // set in order to guarantee that parent cells are loaded before their
        // children. We include all cells on this map to ensure we will see
View Full Code Here

        if (id != null && owners != null && !owners.isEmpty()) {
            // make a request to set the permissions if this is an owner
            Resource ownerRsrc = new OwnerResource(cellRef.get().getCellID().toString(),
                                                   owners);
            ActionMap am = new ActionMap(ownerRsrc, new OwnerAction());
            ResourceMap rm = new ResourceMap();
            rm.put(ownerRsrc.getId(), am);

            SecurityManager sec = AppContext.getManager(SecurityManager.class);
            SecureTask sst = new SetStateTask(id.getUsername(), ownerRsrc.getId(),
                                              this, scss.getPermissions());
            sec.doSecure(rm, sst);
View Full Code Here

            sender.send(clientID, new PermissionsResponseMessage(messageID, send));
            return;
        }

        // construct a request for this user's permissions
        ResourceMap rm = new ResourceMap();
        Action[] actions = crmi.getActions(requestCellID).toArray(new Action[0]);
        ActionMap am = new ActionMap(rsrc, actions);
        rm.put(rsrc.getId(), am);

        // construct a new task to send the message
        SecurityManager sm = AppContext.getManager(SecurityManager.class);
        SecureTask sendTask = new SendPermissionsTask(rsrc.getId(), sender,
                                                      clientID, messageID);
View Full Code Here

        // get the security manager
        SecurityManager security = AppContext.getManager(SecurityManager.class);

        // create a request
        ActionMap am = new ActionMap(resource, actions.toArray(new Action[0]));
        ResourceMap request = new ResourceMap();
        request.put(resource.getId(), am);

        // perform the security check
        security.doSecure(request, new ReceiveSecureTask(resource.getId(),
                                                         clientID, actions,
                                                         message,
View Full Code Here

        // get the security manager
        SecurityManager security = AppContext.getManager(SecurityManager.class);

        // create a request
        ActionMap am = new ActionMap(resource, ConnectAction.getInstance());
        ResourceMap request = new ResourceMap();
        request.put(resource.getId(), am);

        // perform the security check
        security.doSecure(request, new AttachSecureTask(resource.getId(),
                                                        messageID, type,
                                                        properties, ref,
View Full Code Here

        }
        WonderlandServerIdentity id = (WonderlandServerIdentity) curId;

        // create the response object, which will be populated below with
        // any actions that are granted
        ResourceMap grant = new ResourceMap();

        // create a set of actions to schedule in a separate transaction
        ResourceMap schedule = new ResourceMap();

        // loop through each action set in the request, and generate
        // an appropriate response
        for (ActionMap set : request.values()) {
            // get the resource this set pertains to
            Resource resource = set.getResource();

            // create a response set that we will append the granted
            // permissions to
            ActionMap grantSet = new ActionMap(resource);
            grant.put(resource.getId(), grantSet);

            // create a set of requests to schedule.  We do not add the
            // set immediately -- it will be added at the end if it
            // is not empty
            ActionMap scheduleSet = new ActionMap(resource);

            // go through each action, and decider whether to grant or deny
            // access, or if necessary, schedule for later
            for (Action action : set.values()) {
                // query the resource about this permission, and handle the
                // result
                switch (resource.request(id.getIdentity(), action)) {
                    case GRANT:
                        // access is granted, add to the response list
                        grantSet.put(action.getName(), action);
                        break;
                    case DENY:
                        // access is denied -- nothing to do
                        break;
                    case SCHEDULE:
                        // add to the set to schedule
                        scheduleSet.put(action.getName(), action);
                        break;
                }
            }

            // if the schedule set is not empty, add it for scheduling
            if (!scheduleSet.isEmpty()) {
                schedule.put(resource.getId(), scheduleSet);
            }
        }

        // determine if we can respond immediately
        if (schedule.isEmpty()) {
            // nothing to schedule, handle the response directly in
            // this transaction
            task.run(grant);
        } else {
            // schedule the request in a separate thread.  First store
View Full Code Here

        Resource resource = crm.getCellResource(this.cellID);
        if (resource != null) {
            // there is security on this cell perform the enter notification
            // securely
            ActionMap am = new ActionMap(resource, new Action[] { viewAction });
            ResourceMap request = new ResourceMap();
            request.put(resource.getId(), am);

            // perform the security check
            security.doSecure(request, new CellEnteredTask(this, resource.getId(),
                              callId));
        } else {
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.server.security.ResourceMap

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.