Package org.glyptodon.guacamole

Examples of org.glyptodon.guacamole.GuacamoleUnsupportedException


        if (permissions.isEmpty())
            return;

        // Prevent self-de-adminifying
        if (user_id == this.user_id)
            throw new GuacamoleUnsupportedException("Removing your own administrative permissions is not allowed.");

        // Build list of requested system permissions
        List<String> systemPermissionTypes = new ArrayList<String>();
        for (SystemPermission permission : permissions)
            systemPermissionTypes.add(MySQLConstants.getSystemConstant(permission.getType()));
View Full Code Here


            throws GuacamoleException {

        // If user not actually from this auth provider, we can't handle updated
        // permissions.
        if (!(object instanceof MySQLUser))
            throw new GuacamoleUnsupportedException("User not from database.");

        MySQLUser mySQLUser = (MySQLUser) object;

        // Validate permission to update this user is granted
        permissionCheckService.verifyUserAccess(this.user_id,
View Full Code Here

        // Get user pending deletion
        MySQLUser user = userService.retrieveUser(identifier);

        // Prevent self-deletion
        if (user.getUserID() == this.user_id)
            throw new GuacamoleUnsupportedException("Deleting your own user is not allowed.");

        // Validate current user has permission to remove the specified user
        permissionCheckService.verifyUserAccess(this.user_id,
                user.getUserID(),
                MySQLConstants.USER_DELETE);
View Full Code Here

    public void update(Connection object) throws GuacamoleException {

        // If connection not actually from this auth provider, we can't handle
        // the update
        if (!(object instanceof MySQLConnection))
            throw new GuacamoleUnsupportedException("Connection not from database.");

        MySQLConnection mySQLConnection = (MySQLConnection) object;

        // Verify permission to update
        permissionCheckService.verifyConnectionAccess(this.user_id,
View Full Code Here

    @Override
    public void move(String identifier, Directory<String, Connection> directory)
            throws GuacamoleException {
       
        if(!(directory instanceof ConnectionDirectory))
            throw new GuacamoleUnsupportedException("Directory not from database");
       
        Integer toConnectionGroupID = ((ConnectionDirectory)directory).parentID;
       
        // Get connection
        MySQLConnection mySQLConnection =
View Full Code Here

    public void update(ConnectionGroup object) throws GuacamoleException {

        // If connection not actually from this auth provider, we can't handle
        // the update
        if (!(object instanceof MySQLConnectionGroup))
            throw new GuacamoleUnsupportedException("Connection not from database.");

        MySQLConnectionGroup mySQLConnectionGroup = (MySQLConnectionGroup) object;

        // Verify permission to update
        permissionCheckService.verifyConnectionAccess(this.user_id,
View Full Code Here

    @Override
    public void move(String identifier, Directory<String, ConnectionGroup> directory)
            throws GuacamoleException {
       
        if(MySQLConstants.CONNECTION_GROUP_ROOT_IDENTIFIER.equals(identifier))
            throw new GuacamoleUnsupportedException("The root connection group cannot be moved.");
       
        if(!(directory instanceof ConnectionGroupDirectory))
            throw new GuacamoleUnsupportedException("Directory not from database");
       
        Integer toConnectionGroupID = ((ConnectionGroupDirectory)directory).parentID;

        // Get connection group
        MySQLConnectionGroup mySQLConnectionGroup =
                connectionGroupService.retrieveConnectionGroup(identifier, user_id);
       
        if(mySQLConnectionGroup == null)
            throw new GuacamoleResourceNotFoundException("Connection group not found.");

        // Verify permission to update the connection
        permissionCheckService.verifyConnectionAccess(this.user_id,
                mySQLConnectionGroup.getConnectionGroupID(),
                MySQLConstants.CONNECTION_GROUP_UPDATE);
       
        // Verify permission to use the from connection group for organizational purposes
        permissionCheckService.verifyConnectionGroupUsageAccess
                (mySQLConnectionGroup.getParentID(), user_id, MySQLConstants.CONNECTION_GROUP_ORGANIZATIONAL);

        // Verify permission to update the from connection group
        permissionCheckService.verifyConnectionGroupAccess(this.user_id,
                mySQLConnectionGroup.getParentID(), MySQLConstants.CONNECTION_GROUP_UPDATE);
       
        // Verify permission to use the to connection group for organizational purposes
        permissionCheckService.verifyConnectionGroupUsageAccess
                (toConnectionGroupID, user_id, MySQLConstants.CONNECTION_GROUP_ORGANIZATIONAL);

        // Verify permission to update the to connection group
        permissionCheckService.verifyConnectionGroupAccess(this.user_id,
                toConnectionGroupID, MySQLConstants.CONNECTION_GROUP_UPDATE);

        // Verify that no connection already exists with this name.
        MySQLConnectionGroup previousConnectionGroup =
                connectionGroupService.retrieveConnectionGroup(mySQLConnectionGroup.getName(),
                toConnectionGroupID, user_id);
        if(previousConnectionGroup != null)
            throw new GuacamoleClientException("That connection group name is already in use.");
       
        // Verify that moving this connectionGroup would not cause a cycle
        Integer relativeParentID = toConnectionGroupID;
        while(relativeParentID != null) {
            if(relativeParentID == mySQLConnectionGroup.getConnectionGroupID())
                throw new GuacamoleUnsupportedException("Connection group cycle detected.");
           
            MySQLConnectionGroup relativeParentGroup = connectionGroupService.
                    retrieveConnectionGroup(relativeParentID, user_id);
           
            relativeParentID = relativeParentGroup.getParentID();
View Full Code Here

        }

        // Otherwise, inform not supported
        else
            throw new GuacamoleUnsupportedException("Clipboard integration not supported");

    }
View Full Code Here

TOP

Related Classes of org.glyptodon.guacamole.GuacamoleUnsupportedException

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.