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

The Create Activity form contain extra fields #4897

Closed
3 tasks done
sharky98 opened this issue Jun 5, 2024 · 1 comment · Fixed by #4878
Closed
3 tasks done

The Create Activity form contain extra fields #4897

sharky98 opened this issue Jun 5, 2024 · 1 comment · Fixed by #4878
Labels
Milestone

Comments

@sharky98
Copy link
Contributor

sharky98 commented Jun 5, 2024

Describe the issue

As a TeamLead user of Team A, in a Project inside a team-limited Customer to Team A, do the following.

  1. Open a project administration page.
  2. Click on the + to add an activity.
  3. Fill out the only required field (Name).
  4. Click the Save button.
  5. The form is shown again with the error This form should not contain extra fields. The fields related to the budget are not shown anymore.
  6. Click the Save button again, it works.

When doing the same as the System-Admin, I do not have the error showing up. In the past, I modified my Teamlead role permissions so that they can create activity and projects inside a customer they have access. I suspect I didn't add all the required permissions. Is there an easy way to "dump" the current role permissions to help debug?

Otherwise, since the form does save correctly once the field are removed, maybe the form could be loaded without the related fields is the user does not have the required roles?

#2765 seems related.

I already tried

Kimai version

2.15.0

How do you run Kimai?

Docker

Which PHP version are you using?

8.2

Logfile

No response

Screenshots

create-activity-form

create-activity-form-result

@sharky98 sharky98 added the bug label Jun 5, 2024
kevinpapst added a commit that referenced this issue Jun 5, 2024
@kevinpapst
Copy link
Member

kevinpapst commented Jun 5, 2024

Thanks for sharing 👍

I found one place that might be related, even though I am not sure. I hope it can fix this problem.
My assumption is that after submitting the form, the project is loaded too late and therefor the permission is checked globally. And the global budget permission is not active for teamleads (only this project specific one).

Anyway, this is the commit: 42bb2f5
you could try to change it on your end and retest.

@kevinpapst kevinpapst added this to the 2.18 milestone Jun 16, 2024
@kevinpapst kevinpapst closed this as completed by moving to Done in Roadmap Kimai Jun 16, 2024
@kevinpapst kevinpapst mentioned this issue Jun 16, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants