Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Nov 26, 2025

  • Checking write permissions on User Permission is incorrect, because we will either create or delete them.
  • The called functions add_user_permission / remove_user_permission will do the correct permission checks.
  • If a user tries to change the value of User ID or Create User Permission but does not have permissions to add/remove User Permission, they should get an error. Otherwise we'll get inconsistent system states (e.g. an Employee has Create User Permission enabled, but the corresponding User Permissions are missing).

Alternative: ignore permissions altogether, HR users need to change these fields but shouldn't have permissions on User Permission otherwise.


This is an automatic backport of pull request #47016 done by Mergify.

(cherry picked from commit 046bcfa)

# Conflicts:
#	erpnext/setup/doctype/employee/employee.py
(cherry picked from commit 08f21c7)

# Conflicts:
#	erpnext/setup/doctype/employee/employee.py
@mergify mergify bot added the conflicts label Nov 26, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Nov 26, 2025

Cherry-pick of 046bcfa has failed:

On branch mergify/bp/version-15-hotfix/pr-47016
Your branch is up to date with 'origin/version-15-hotfix'.

You are currently cherry-picking commit 046bcfa606.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/setup/doctype/employee/employee.py

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 08f21c7 has failed:

On branch mergify/bp/version-15-hotfix/pr-47016
Your branch is ahead of 'origin/version-15-hotfix' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 08f21c7905.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   erpnext/hooks.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/setup/doctype/employee/employee.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts needs-tests This PR needs automated unit-tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants