Examples of chown()


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

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

    /**
     * DBA can change the owner gid of a resource
     *
 
View Full Code Here

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

                        CollectionManagementService mgtService = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
                        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) {
View Full Code Here

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

        Collection col = null;
        try {
            col = DatabaseManager.getCollection(baseUri + collectionUri, uid, pwd);
            final UserManagementService ums = (UserManagementService) col.getService("UserManagementService", "1.0");
           
            ums.chown(ums.getAccount(owner_uid), group_gid);
        } catch(final XMLDBException xmldbe) {
            throw new ApiException(xmldbe);
        } finally {
            if(col != null) {
                try {
View Full Code Here

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

            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.chown(resource, ums.getAccount(owner_uid), group_gid);
        } catch(final XMLDBException xmldbe) {
            throw new ApiException(xmldbe);
        } finally {
            if(col != null) {
                try {
View Full Code Here

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

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

    /**
     * Owner can NOT change the owner gid of a resource
     * to a group of which they are not a member
View Full Code Here

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

        final Resource resource = test.getResource("test.xml");
        final UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        // attempt to take uid ownership of /db/securityTest1/test.xml
        final Account test2 = ums.getAccount("test2");
        ums.chown(resource, test2);
    }

    /**
     * Owner can change the owner gid of a resource
     * to a group of which they are a member
View Full Code Here

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

        test.storeResource(xqueryResource);

        //set the xquery to be owned by 'test1':'users' and set it 'setgid', and set it 'rx' by ohers, so 'test3' can execute it!
        UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");
        xqueryResource = test.getResource("setgid.xquery");
        ums.chown(xqueryResource, ums.getAccount("test1"), "users");
        ums.chmod(xqueryResource, 02705); //setgid

        //create a collection for the XQuery to write into
        final CollectionManagementService cms = (CollectionManagementService)test.getService("CollectionManagementService", "1.0");
        final Collection colForSetUid = cms.createCollection("forSetGidWrite");
View Full Code Here

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

            CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection test = cms.createCollection("securityTest1");
            ums = (UserManagementService) test.getService("UserManagementService", "1.0");
            //change ownership to test1
            final Account test1 = ums.getAccount("test1");
            ums.chown(test1, "users");
            // full permissions for user and group, none for world
            ums.chmod(0770);

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

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

            // create a collection /db/securityTest2 as user "test1"
            cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection testCol2 = cms.createCollection("securityTest2");
            ums = (UserManagementService) testCol2.getService("UserManagementService", "1.0");
            //change ownership to test1
            ums.chown(test1, "users");
            // full permissions for user and group, none for world
            ums.chmod(0775);

            // create a collection /db/securityTest3 as user "test3"
            cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
View Full Code Here

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

            cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection testCol3 = cms.createCollection("securityTest3");
            ums = (UserManagementService) testCol3.getService("UserManagementService", "1.0");
            //change ownership to test3
            final Account test3 = ums.getAccount("test3");
            ums.chown(test3, "users");
            // full permissions for all
            ums.chmod(0777);
        } catch(final XMLDBException xmldbe) {
            xmldbe.printStackTrace();
            fail(xmldbe.getMessage());
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.