Package org.jdesktop.wonderland.modules.security.common

Examples of org.jdesktop.wonderland.modules.security.common.ActionDTO


        // add all the actions
        CellResourceManagerInternal crmi =
                AppContext.getManager(CellResourceManagerInternal.class);
        for (Action a : crmi.getActions(cellID)) {
            out.getAllActions().add(new ActionDTO(a));
        }

        logger.fine("[SecurityComponentMO] writing " +
                    out.getPermissions().size() + " permissions.");
View Full Code Here


        Resource rsrc = crmi.getCellResource(requestCellID);
        if (rsrc == null) {
            // no resource -- send permission for everything
            Set<ActionDTO> send = new LinkedHashSet<ActionDTO>();
            for (Action action : crmi.getActions(requestCellID)) {
                send.add(new ActionDTO(action));
            }
            sender.send(clientID, new PermissionsResponseMessage(messageID, send));
            return;
        }
View Full Code Here

        public void run(ResourceMap granted) {
            // find the permissions for this user
            ActionMap am = granted.get(resourceID);
            Set<ActionDTO> actions = new LinkedHashSet<ActionDTO>();
            for (Action a : am.values()) {
                actions.add(new ActionDTO(a));
            }

            // create the message
            PermissionsResponseMessage prm =
                    new PermissionsResponseMessage(requestID, actions);
View Full Code Here

         * @return true if the given principal has permission for the given
         * action, or false if it is denied or undefined.
         */
        protected Permission getPermission(Principal p, Action action) {
            // construct a prototype permission to search for
            Permission search = new Permission(p, new ActionDTO(action), null);

            // use the sorted set to find the first matching permission.
            // This will correspond to the permission for this user
            // if it is defined.
            Permission perm = null;
View Full Code Here

            }
        }

        // add view permissions for all users
        Principal p = new Principal("users", Principal.Type.EVERYBODY);
        ActionDTO view = new ActionDTO(new ViewAction());
        perms.getPermissions().add(new Permission(
                p, view, Permission.Access.GRANT));
        ActionDTO modify = new ActionDTO(new ModifyAction());
        perms.getPermissions().add(new Permission(
                p, modify, Permission.Access.DENY));

        state.setPermissions(perms);
        return (T) state;
View Full Code Here

        // build the tree of actions
        Map<Action, DefaultMutableTreeNode> actions =
                new HashMap<Action, DefaultMutableTreeNode>();
        while (!aps.isEmpty()) {
            for (Iterator<ActionDTO> i = aps.iterator(); i.hasNext();) {
                ActionDTO actionDTO = i.next();
                Action action = actionDTO.getAction();
                DefaultMutableTreeNode node = null;

                if (action.getParent() == null) {
                    // top level action
                    node = new DefaultMutableTreeNode(new ActionHolder(action));
View Full Code Here

            ActionHolder ah = (ActionHolder) node.getUserObject();

            if (ah.getAccess() != null) {
                res.add(new Permission(p.getPrincipal(),
                        new ActionDTO(ah.getAction()),
                        ah.getAccess()));
            }
        }

        perms.setPerms(p.getPrincipal(), res);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.security.common.ActionDTO

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.