Package org.teiid.query.eval

Examples of org.teiid.query.eval.SecurityFunctionEvaluator



public class SecuritySystemFunctions {

    public static boolean hasRole(CommandContext context, Object roleName) throws FunctionExecutionException {
        SecurityFunctionEvaluator eval = context.getSecurityFunctionEvaluator();
       
        if (eval == null) {
            return true;
        }
       
        try {
            return eval.hasRole(SecurityFunctionEvaluator.DATA_ROLE, (String)roleName);
        } catch (TeiidComponentException err) {
            throw new FunctionExecutionException(err, err.getMessage());
        }
    }
View Full Code Here


        }
    }
 
    public static boolean hasRole(CommandContext context, Object roleType, Object roleName) throws FunctionExecutionException {
       
        SecurityFunctionEvaluator eval = context.getSecurityFunctionEvaluator();
       
        if (eval == null) {
            return true;
        }
       
        try {
            return eval.hasRole((String)roleType, (String)roleName);
        } catch (TeiidComponentException err) {
            throw new FunctionExecutionException(err, err.getMessage());
        }
    }
View Full Code Here

        dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1", new List[] { //$NON-NLS-1$
            Arrays.asList(new Object[] { "fooRole", new Integer(0) }), //$NON-NLS-1$ 
        });
       
        CommandContext context = new CommandContext();
        context.setSecurityFunctionEvaluator(new SecurityFunctionEvaluator() {
            public boolean hasRole(String roleType,
                                   String roleName) throws TeiidComponentException {
                return false;
            }});
       
View Full Code Here

TOP

Related Classes of org.teiid.query.eval.SecurityFunctionEvaluator

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.