Examples of authorized()


Examples of com.cloud.serializer.Param.authorized()

                continue; // skip fields w/o serialized name
            }

            Param param = field.getAnnotation(Param.class);
            if (param != null) {
                RoleType[] allowedRoles = param.authorized();
                if (allowedRoles.length > 0) {
                    boolean permittedParameter = false;
                    Account caller = CallContext.current().getCallingAccount();
                    for (RoleType allowedRole : allowedRoles) {
                        if (allowedRole.getValue() == caller.getType()) {
View Full Code Here

Examples of com.cloud.serializer.Param.authorized()

        }
        public boolean shouldSkipField(FieldAttributes f) {

            Param param = f.getAnnotation(Param.class);
            if (param != null) {
                RoleType[] allowedRoles = param.authorized();
                if (allowedRoles.length > 0) {
                    boolean permittedParameter = false;
                    Account caller = CallContext.current().getCallingAccount();
                    for (RoleType allowedRole : allowedRoles) {
                        if (allowedRole.getValue() == caller.getType()) {
View Full Code Here

Examples of com.s3auth.hosts.Host.authorized()

        MatcherAssert.assertThat(
            host.isHidden(new URI("/some-uri")),
            Matchers.is(false)
        );
        MatcherAssert.assertThat(
            host.authorized("user-name", "user-password"),
            Matchers.is(true)
        );
        MatcherAssert.assertThat(
            host,
            Matchers.hasToString(Matchers.equalTo("localhost"))
View Full Code Here

Examples of org.apache.cloudstack.api.APICommand.authorized()

    @Override
    public boolean start() {
        for (PluggableService service : _services) {
            for (Class<?> clz : service.getCommands()) {
                APICommand command = clz.getAnnotation(APICommand.class);
                for (RoleType role : command.authorized()) {
                    Set<String> commands = annotationRoleBasedApisMap.get(role);
                    if (!commands.contains(command.name()))
                        commands.add(command.name());
                }
            }
View Full Code Here

Examples of org.apache.cloudstack.api.APICommand.authorized()

        for (PluggableService service : _services) {
            for (Class<?> cmdClass : service.getCommands()) {
                APICommand command = cmdClass.getAnnotation(APICommand.class);
                if (!commandsPropertiesOverrides.contains(command.name())) {
                    for (RoleType role : command.authorized()) {
                        addDefaultAclPolicyPermission(command.name(), cmdClass, role);
                    }
                 }
             }
         }
View Full Code Here

Examples of org.apache.cloudstack.api.APICommand.authorized()

    @Override
    public boolean start() {
        for ( PluggableService service : _services ) {
            for ( Class<?> clz : service.getCommands() ) {
                APICommand command = clz.getAnnotation(APICommand.class);
                for ( RoleType role : command.authorized() ) {
                    Set<String> commands = annotationRoleBasedApisMap.get(role);
                    if (!commands.contains(command.name()))
                        commands.add(command.name());
                }
            }
View Full Code Here

Examples of org.apache.cloudstack.api.Parameter.authorized()

            if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
                continue;
            }

            //TODO: Annotate @Validate on API Cmd classes, FIXME how to process Validate
            RoleType[] allowedRoles = parameterAnnotation.authorized();
            if (allowedRoles.length > 0) {
                boolean permittedParameter = false;
                Account caller = CallContext.current().getCallingAccount();
                for (RoleType allowedRole : allowedRoles) {
                    if (allowedRole.getValue() == caller.getType()) {
View Full Code Here

Examples of org.apache.openejb.junit.TestSecurity.authorized()

            testSecurity = getTestClass().getJavaClass().getAnnotation(TestSecurity.class);
        }

        // no security to run as, just create a normal statement
        if (testSecurity == null ||
                (testSecurity.authorized().length == 0 && testSecurity.unauthorized().length == 0)) {
            return createUnsecuredStatement(method);
        }
        // security roles specified, create separate statements for them all
        else {
            return createSecuredStatementExecutor(method, testSecurity);
View Full Code Here

Examples of org.apache.openejb.junit.TestSecurity.authorized()

            testSecurity = getTestClass().getJavaClass().getAnnotation(TestSecurity.class);
        }

        // no security to run as, just create a normal statement
        if (testSecurity == null ||
                (testSecurity.authorized().length == 0 && testSecurity.unauthorized().length == 0)) {
            return createUnsecuredStatement(method);
        }
        // security roles specified, create separate statements for them all
        else {
            return createSecuredStatementExecutor(method, testSecurity);
View Full Code Here

Examples of org.encuestame.utils.oauth.StandardOAuthSession.authorized()

     * @throws EnMeNotValidKeyOAuthSecurityException
     */
    public ApplicationConnection grantAccess(String requestToken) throws EnMeNotValidKeyOAuthSecurityException {
        log.debug("Grant Access");
        StandardOAuthSession session = getStandardSession(requestToken);
        if (!session.authorized()) {
            throw new IllegalStateException("OAuthSession is not yet authorized");
        }
        log.debug("Grant Access is authorized "+session.authorized());
        try {
            ApplicationConnection connection = this.applicationDao.connectApplication(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.