Skip to content
Merged
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
6 changes: 3 additions & 3 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) {
}

// Check for role change and modify accordingly
if (aUser.role === userRoles.length - 1) {
if (aUser.role === 5) {
if (!aUser.save) {
// Probably using req.session.user which may have gotten serialized.
userDoc = aUser;
Expand All @@ -1352,7 +1352,7 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) {
return;
}

--aUser.role;
aUser.role = 4;
aUser.save(function (aErr, aUser) {
if (aErr) {
console.warn('MongoDB User save warning error\n' +
Expand All @@ -1365,7 +1365,7 @@ exports.storeScript = function (aUser, aMeta, aBuf, aCallback, aUpdate) {
});
});
} else {
--aUser.role;
aUser.role = 4;
aUser.save(function (aErr, aUser) {
if (aErr) {
console.warn('MongoDB User save warning error\n' +
Expand Down