All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lib.xp.examples.node.modifyRootPermissions.js Maven / Gradle / Ivy

The newest version!
var assert = require('/lib/xp/testing');

// BEGIN
var nodeLib = require('/lib/xp/node');

// Connect to repo
var repo = nodeLib.connect({
    repoId: 'com.enonic.cms.default',
    branch: 'master'
});


// Update root-permissions
var result1 = repo.setRootPermissions({
    _permissions: [
        {
            'principal': 'role:system.admin',
            'allow': [
                'READ',
                'CREATE',
                'MODIFY',
                'DELETE',
                'PUBLISH',
                'READ_PERMISSIONS',
                'WRITE_PERMISSIONS'
            ],
            'deny': []
        }
    ],
    _inheritsPermissions: true
});

log.info('Modified root node with inheritsPermissions = [%s], permissions: %s', result1._inheritsPermissions,
    JSON.stringify(result1._permissions, null, 4));
// END





© 2015 - 2024 Weber Informatics LLC | Privacy Policy