Examples of UserManagementService


Examples of org.exist.xmldb.UserManagementService

    @Test
    public void groupChmodResource_asOwner() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final Resource resource = test.getResource("test.xml");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
        // grant myself all rights ;-)
        ums.chmod(resource, 0777);
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to 'test2' user
     */
    @Test
    public void dbaChownUidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "admin", "");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to change uid ownership of /db/securityTest1 to the test2 user
        final Account test2 = ums.getAccount("test2");
        ums.chown(test2);
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to 'guest' group
     */
    @Test
    public void dbaChownGidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "admin", "");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to change uid ownership of /db/securityTest1 to the guest group
        ums.chgrp("guest");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to 'test2' user
     */
    @Test(expected=XMLDBException.class)
    public void ownerChownUidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to change uid ownership of /db/securityTest1 to the test2 user
        final Account test2 = ums.getAccount("test2");
        ums.chown(test2);
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to 'guest' group
     */
    @Test(expected=XMLDBException.class)
    public void ownerChownGidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to change gid ownership of /db/securityTest1 to the guest group
        ums.chgrp("guest");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to ourselves
     */
    @Test(expected=XMLDBException.class)
    public void groupMemberChownUidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test2", "test2");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to take uid ownership of /db/securityTest1
        final Account test2 = ums.getAccount("test2");
        ums.chown(test2);
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to the group 'extusers'
     */
    @Test
    public void ownerAndGroupMemberChownGidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to take gid ownership of /db/securityTest1
        ums.chgrp("extusers");

        final Permission perms = ums.getPermissions(test);
        assertEquals("extusers", perms.getGroup().getName());
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to the group 'users' (of which they are a member)
     */
    @Test(expected=XMLDBException.class)
    public void groupMemberChownGidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test2", "test2");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to take gid ownership of /db/securityTest1/test.xml
        ums.chgrp("users");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     * to the group 'guest' (of which they are NOT a member)
     */
    @Test(expected=XMLDBException.class)
    public void groupNonMemberChownGidCollection() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test2", "test2");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to take gid ownership of /db/securityTest1
        ums.chgrp("guest");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService

     */
    @Test
    public void dbaChownUidResource() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "admin", "");
        final Resource resource = test.getResource("test.xml");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to change uid ownership of /db/securityTest1/test.xml to the test2 user
        final Account test2 = ums.getAccount("test2");
        ums.chown(resource, test2);
    }
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.