Ephigenia / mite-cli

command line interface for time tracking service mite.yo.lk
MIT License
19 stars 8 forks source link

mite-cli lists time entries of all users #3

Closed yolk closed 5 years ago

yolk commented 6 years ago

mite list always returns all time entries of all users in a multiuser mite account. You should send the parameter user_id set to current with every request to time_entries.json to only return the time entries of the current user. Maybe there could be some way to overwrite this if needed?

Ephigenia commented 5 years ago

I was thinking about adding "current" as the default value for the "user_id" parameter of mite list.

For the use cases, I could think of, it seems to be okay that the user_id option is not used by default and also doesn’t have a default value.

When the API key belongs to an admin or owner of the account you’ll always see all user’s time entries unless you specify the user_id option and set it to "current" or a CSV list of user ids: mite list --user_id=current which returns only your entries or mite list --user_id=83718,12737 which returns entries of a these users.

When your API key belongs to a time-tracking account you will only get your time entries.

What do you think?

yolk commented 5 years ago

Thanks for your reply. I guess it boils down to the use cases you have in mind.

If you regard the mite list output as something like the reports section in mite your option seems valid. But if you look at it more like the daily time entries view, I guess it should default to only the entries of the current user, regardless of the role of the current user.

But these are only my two cents ;)

yolk commented 5 years ago

Oh, I forgot my best argument :)

At the moment there is no column mentioning the user name when running mite list; so there is no way I could distinguish my entries from the ones made by my colleagues.

Ephigenia commented 5 years ago

At the moment there is no column mentioning the user name when running mite list; so there is no way I could distinguish my entries from the ones made by my colleagues.

Yes, you’re right. I’ll add the user column to the reported table then … #4

Ephigenia commented 5 years ago

I’m closing this issue now. I guess there are some people who would like to have mite list show only their entries but also some who which to see them all. As there‘s no clean way to set a default and be able to unset it on demand I think the people who wish to see only their entries can create an alias which always calls mite list --user_id=current.

As far as there are no other users mentioning this I’ll keep it like it is.