Examples of chmod()


Examples of org.exist.xmldb.UserManagementService.chmod()

    @Test
    public void groupChmodCollection_asOwner() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
        // grant myself all rights ;-)
        ums.chmod(07777);

        assertEquals("rwsrwsrwt", ums.getPermissions(test).toString());
    }

    @Test(expected=XMLDBException.class)
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

    public void groupChmodResource_asNotOwnerAndNotDBA() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test2", "test2");
        final Resource resource = test.getResource("test.xml");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
        // grant myself all rights ;-)
        ums.chmod(resource, 0777);
    }

    @Test
    public void groupChmodResource_asOwner() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

    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);
    }

    /**
     * DBA can change the owner uid of a collection
     *
 
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

                        col = mgtService.createCollection(XUPDATE_COLLECTION);
                        UserManagementService ums = (UserManagementService) col.getService("UserManagementService", "1.0");
                        // change ownership to guest
                        Account guest = ums.getAccount("guest");
                        ums.chown(guest, guest.getPrimaryGroup());
                        ums.chmod(Permission.DEFAULT_COLLECTION_PERM);

                        System.out.println("collection created.");
                    }
            } catch (Exception e) {
                    e.printStackTrace();
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

        Collection col = null;
        try {
            col = DatabaseManager.getCollection(baseUri + collectionUri, uid, pwd);
            final UserManagementService ums = (UserManagementService) col.getService("UserManagementService", "1.0");

            ums.chmod(mode);
        } catch(final XMLDBException xmldbe) {
            throw new ApiException(xmldbe);
        } finally {
            if(col != null) {
                try {
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

        try {
            col = DatabaseManager.getCollection(baseUri + getCollectionUri(resourceUri), uid, pwd);
           
            final Resource resource = col.getResource(getResourceName(resourceUri));
            final UserManagementService ums = (UserManagementService) col.getService("UserManagementService", "1.0");
            ums.chmod(resource, mode);
        } catch(final XMLDBException xmldbe) {
            throw new ApiException(xmldbe);
        } finally {
            if(col != null) {
                try {
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

    @Test
    public void onlyExecuteRequiredToOpenCollectionContent() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");

        ums.chmod("--x------");
        test.close();

        DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

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

        ums.chmod("rw-rw-rw-");
        test.close();

        DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

    @Test
    public void canOpenCollectionWithExecute() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");

        ums.chmod("--x--x--x");
        test.close();

        DatabaseManager.getCollection(baseUri + "/db/securityTest1", "test1", "test1");
    }
View Full Code Here

Examples of org.exist.xmldb.UserManagementService.chmod()

    @Test(expected=XMLDBException.class)
    public void cannotOpenRootCollectionWithoutExecute() throws XMLDBException {
        final Collection test = DatabaseManager.getCollection(baseUri + "/db", "admin", "");
        final UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");

        ums.chmod("rw-rw-rw-");
        test.close();

        DatabaseManager.getCollection(baseUri + "/db", "test1", "test1");
    }
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.