Examples of JDBCAuthorizationManager


Examples of org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager

        RealmConfigXMLProcessor xmlProcessor = new RealmConfigXMLProcessor();
        InputStream stream = new FileInputStream("target/clear-resources/user-mgt-clear.xml");
        RealmConfiguration configuration = xmlProcessor.buildRealmConfiguration(stream);

        JDBCAuthorizationManager jdbcAuthnManager = new JDBCAuthorizationManager(configuration, properties, null, null, realm, 0);

        String[] roles = jdbcAuthnManager.getAllowedRolesForResource("/permission/admin", "ui.execute");
        assertEquals(roles.length,1);

        jdbcAuthnManager.clearPermissionTree();
       
        //the tree should automatically be loaded on next call
        roles = jdbcAuthnManager.getAllowedRolesForResource("/permission/admin", "ui.execute");
        assertEquals(roles.length,1);
    }
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.