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

Check permissions #57

Open
AlexandrePTJ opened this issue Sep 12, 2022 · 8 comments
Open

Check permissions #57

AlexandrePTJ opened this issue Sep 12, 2022 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@AlexandrePTJ
Copy link
Owner

AlexandrePTJ commented Sep 12, 2022

  • On test process
  • On the "login" process

Check for kimai's rights to ensure

  • user is able to list project/customer/activity/timesheet (mandatory)
  • user is able to add/edit (optional)
@AlexandrePTJ AlexandrePTJ added the enhancement New feature or request label Sep 12, 2022
@AlexandrePTJ AlexandrePTJ added this to the Next milestone Sep 12, 2022
@AlexandrePTJ AlexandrePTJ modified the milestones: Next, 0.8, 0.9, 1.0 Mar 14, 2023
@AlexandrePTJ AlexandrePTJ added the good first issue Good for newcomers label May 15, 2023
@muxelplexer
Copy link
Contributor

While implementing the Team model i noticed a minor issues with the current kimaiAPI.h file:
Due to it being included nearly everywhere any change inside it causes a complete rebuild which takes it's time.

Is it fine if new API models would be implemented inside an api/models/ folder structure?

Looking forward to sugesstions/opinions

@muxelplexer
Copy link
Contributor

muxelplexer commented May 16, 2023

Also: We get all activities from the endpoint no matter if the user has permissions to book it or not, Do we hide it from the dropdown if the uses misses permissions or deactivate the button and display a info note/display it in a "Unavailable" tab in the dropdown?

Otherwise we'd need to require the user to have the view_team permission to use the team endpoint.

@AlexandrePTJ
Copy link
Owner Author

While implementing the Team model i noticed a minor issues with the current kimaiAPI.h file: Due to it being included nearly everywhere any change inside it causes a complete rebuild which takes it's time.

Is it fine if new API models would be implemented inside an api/models/ folder structure?

Looking forward to sugesstions/opinions

As Kimai API is pretty stable, this file is not changing often. Also this project is pretty small, so I am not sure it will have a real impact. However, test it and we will see :)

@AlexandrePTJ
Copy link
Owner Author

Also: We get all activities from the endpoint no matter if the user has permissions to book it or not, Do we hide it from the dropdown if the uses misses permissions or deactivate the button and display a info note/display it in a "Unavailable" tab in the dropdown?

Otherwise we'd need to require the user to have the view_team permission to use the team endpoint.

I think it would be more easy to just hide what user cannot book. It then allow to focus only what user can change.

@muxelplexer
Copy link
Contributor

Either i'm going crazy or Kimai changed something upstream?
I do not seem to receive any Activities, Projects or Customers for which i do not have booking permissions for, just like in the
web ui. I suppose i'll be implementing the modify/add permission checks instead then?

@muxelplexer
Copy link
Contributor

Also i can't find a convenient way to check for permissions apart from trying to launch invalid requests and checking for a 403.
We can receive the roles a user is a member of but not the perms a roles has :/

@AlexandrePTJ
Copy link
Owner Author

Ok I didn't really dig into roles/permissions API. It looks to be a bit limited as you said. So let this features aside for the moment. I will ask to kimai dev if fetching permissions from API is planned.

@AlexandrePTJ
Copy link
Owner Author

kimai/kimai#4061

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants