> var noActionsPriv = { resource:
{ db: "", collection: "" }, actions: [] };
> db.runCommand(
{ grantPrivilegesToRole: "roleName", privileges: [ noActionsPriv ] });
> db.runCommand(
);
This is a bug for the sake of consistency with other privilege-related commands. For example, the createRole() command will fail if you pass in a privilege with an empty 'actions' array. These commands require at least one specified action in order to succeed.