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

Do not allow time tracking for users that are not visible to you #17793

Merged

Conversation

klaustopher
Copy link
Contributor

Ticket

https://community.openproject.org/projects/stream-time-and-costs/work_packages/61084

What are you trying to accomplish?

Prevent logging time for users that cannot be accessed by the user. This is currently only prevented by the auto completer, but not by the backend.

Screenshots

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

Sorry, something went wrong.

Comment on lines -120 to -121
def validate_logged_by_current_user
errors.add :logged_by_id, :not_current_user if model.logged_by != logged_by
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this validation was never run, and logged_by is not even defined, so using it will throw a NoMethodError

Copy link
Member

@oliverguenther oliverguenther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 👍 Some API tests are still failing

@klaustopher klaustopher merged commit 753444d into dev Feb 3, 2025
10 checks passed
@klaustopher klaustopher deleted the bug/61084-when-allowed-to-log-time-entries-for-others branch February 3, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants