Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cec control-content share -o 'viewer' #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sites/bin/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3340,6 +3340,7 @@ var _updateCollectionPermission = function (server, repository, collections, use
server: server,
id: collection.id,
repositoryId: repository.id,
viewAllCollectionsEnabled: repository.viewAllCollectionsEnabled,
type: 'collection'
}));
});
Expand Down
4 changes: 2 additions & 2 deletions sites/bin/cec/cec.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ var getResourceRoles = function () {
};

var getCollectionRoles = function () {
const roles = ['manager', 'contributor'];
const roles = ['manager', 'contributor', 'viewer'];
return roles;
};

Expand Down Expand Up @@ -15138,4 +15138,4 @@ if (!process.shim) {

// console.log(spawnCmd);
process.exit(spawnCmd ? spawnCmd.status : 0);
}
}
6 changes: 3 additions & 3 deletions sites/test/server/serverRest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4878,12 +4878,12 @@ module.exports.getCategoryProperties = function (args) {
});
};

var _getResourcePermissions = function (server, id, type, repositoryId) {
var _getResourcePermissions = function (server, id, type, repositoryId, viewAllCollectionsEnabled=false) {
return new Promise(function (resolve, reject) {
var resourceType = type === 'repository' ? 'repositories' : (type + 's');
var url;
if (type === 'collection') {
url = server.url + '/content/management/api/v1.1/repositories/' + repositoryId + '/collections/' + id + '/permissions';
url = server.url + '/content/management/api/v1.1/repositories/' + repositoryId + '/collections/' + id + '/permissions?isCollectionOnly=' + !viewAllCollectionsEnabled;
} else {
url = server.url + '/content/management/api/v1.1/' + resourceType + '/' + id + '/permissions';
}
Expand Down Expand Up @@ -4938,7 +4938,7 @@ var _getResourcePermissions = function (server, id, type, repositoryId) {
* @returns {Promise.<object>} The data object returned by the server.
*/
module.exports.getResourcePermissions = function (args) {
return _getResourcePermissions(args.server, args.id, args.type, args.repositoryId);
return _getResourcePermissions(args.server, args.id, args.type, args.repositoryId, args.viewAllCollectionsEnabled);
};


Expand Down