Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
steam0r committed Jan 13, 2025
2 parents 1c8cf64 + 249ec95 commit b61ac80
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions shared/api/utils/shared_ops_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,14 @@ export default class SharedOpsUtil extends SharedUtil
return attachment;
}

/**
* @abstract
*/
userHasReadRightsOp(user, opName, teams = null, project = null, opOwner = null)
{
throw new Error("not implemented, abstract class");
}

userHasWriteRightsOp(user, opName, teams = [], project = null, ignoreAdmin = false)
{
if (!user) return false;
Expand Down Expand Up @@ -2588,12 +2596,12 @@ export default class SharedOpsUtil extends SharedUtil
{
if (!this.userHasWriteRightsOp(userObj, newName, teams, newOpProject))
{
problems.no_rights_target = "You lack permissions to " + newName + ".";
problems.no_rights_target = "You lack write permissions to " + newName + ".";
}

if (oldName)
{
if (!this.userHasWriteRightsOp(userObj, oldName, teams, oldOpProject)) problems.no_rights_source = "You lack permissions to " + oldName + ".";
if (!this.userHasReadRightsOp(userObj, oldName, teams, oldOpProject)) problems.no_rights_source = "You lack read permissions to " + oldName + ".";
if (!oldOpExists) problems.not_found_source = oldName + " does not exist.";
}
}
Expand Down

0 comments on commit b61ac80

Please sign in to comment.