Package org.apache.qpid.server.security.access

Examples of org.apache.qpid.server.security.access.PrincipalPermissions


        }
    }

    public AuthzResult authoriseDelete(PrincipalHolder session, Exchange exchange)
    {
        PrincipalPermissions principalPermissions = _users.get(session.getPrincipal().getName());
        if (principalPermissions == null)
        {
            return AuthzResult.DENIED;
        }
        else
        {
            return principalPermissions.authorise(Permission.DELETE);
        }
    }
View Full Code Here


    }

    public AuthzResult authorisePublish(PrincipalHolder session, boolean immediate, boolean mandatory,
            AMQShortString routingKey, Exchange e)
    {
        PrincipalPermissions principalPermissions = _users.get(session.getPrincipal().getName());
        if (principalPermissions == null)
        {
            return AuthzResult.DENIED;
        }
        else
        {
            return principalPermissions.authorise(Permission.PUBLISH, e, routingKey);
        }
    }
View Full Code Here

        }
    }

    private void grant(Permission permission, String user, Object... parameters)
    {
        PrincipalPermissions permissions = _users.get(user);

        if (permissions == null)
        {
            permissions = new PrincipalPermissions(user);
        }

        _users.put(user, permissions);
        permissions.grant(permission, parameters);
    }
View Full Code Here

        }

        String username = session.getAuthorizedID().getName();

        //Get the Users Permissions
        PrincipalPermissions permissions = _users.get(username);

        if (permissions != null)
        {
            switch (permission)
            {
                case ACCESS:
                    return GRANTED;
                case BIND:  // Body QueueDeclareBody - Parameters : Exchange, Queue, QueueName
                    // Body QueueBindBody - Paramters : Exchange, Queue, QueueName
                    if (parameters.length == 3)
                    {
                        // Parameters : Exchange, Queue, RoutingKey
                        if (permissions.authorise(Permission.BIND, body, parameters[0], parameters[1], parameters[2]))
                        {
                            return GRANTED;
                        }
                    }
                    break;
                case CONSUME: // Parameters : none
                    if (parameters.length == 1 && permissions.authorise(Permission.CONSUME, parameters[0]))
                    {
                        return GRANTED;
                    }
                    break;
                case CREATE: // Body : QueueDeclareBody | ExchangeDeclareBody - Parameters : none
                    if (permissions.authorise(Permission.CREATE, body))
                    {
                        return GRANTED;
                    }
                    break;
                case PUBLISH: // Body : BasicPublishBody  Parameters : exchange
                    if (parameters.length == 1 && parameters[0] instanceof Exchange)
                    {
                        if (permissions.authorise(Permission.PUBLISH, ((Exchange) parameters[0]).getName(),
                                                  ((BasicPublishBody) body).getRoutingKey()))
                        {
                            return GRANTED;
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.access.PrincipalPermissions

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.