-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add basic multiple admin users #1
base: master
Are you sure you want to change the base?
Conversation
Just a general suggestion:
To prevent this, please:
|
Hi @CommanderStorm, thanks for taking time giving me such interesting suggestion 👍🏼
That's a good reason to not merge it. My approach try to be far simpler so I guess it should avoid the first issue. And for the second one, I'm not that kind of people.
You are perfectly right, my proposal will only contains code related to basic multi admin account support, nothing else. If you are okay, once my code will be working, could you please take a first look and indicate me the "tests [that] makes sense" I should add? |
@CommanderStorm sorry to disturb you, I have a question about translations. I have a few translations to add, I currently add them in At the end, I dont know how to properly handle translations in my PR 🤷🏼♂️ |
Please only add the strings which are translatable to The translations can then (after merging a PR into master) be translated by our army of translators over at weblate
No worries, ping me as many times as you want ^^
What are you confused about (where do we need to update the docs?) |
This is awesome, you are so reactive! Thanks a lot!
😘
As I try to explain (sorry it was probably unclear), this section: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#translations contains only one link which is broken (404): So I never found how to handle translations "properly", I mean in a way it's acceptable at PR review time. To be perfectly clear, the missing information is the one you gently provide:
I guess that information would be originally provided on the broken link page 🕳️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that, I think, is worth commenting on despite you not being done with this PR:
Previously, the relationship between monitors/.. and users was that users “own” the monitors (despite us not having more than one user).
Now you are changing the relationship to not have these checks any more.
- Things which previously were namespaced to a user now are in a global scope.
- This makes some interactions impossible
- one user not seeing all the monitors
- one user granting another user access to some of their monitors.
I am fine with this change, but I am not the bdfl (Louis).
He will likely need a reason why all of these checks are removed.
No worries, your comments are more than welcome! 🤗
My approach is: we store in the DB the user id of the ressource creator (here monitors) which is a different concept of ressource owner. After my change, ressources are totally user independent. Without that, "multiple admin user" makes no sense. To be honest, I was very surprised to discover that "user relationship" since, until now, UK assume that only one user can exist... 🤷🏼♂️ IMHO, that user ownership implementation is nothing else over-engineering:
wdyt? |
My thoughts on this are kind of irrelevant. (as stated above: I am not the bdfl...) Only Louis vote really matters. I think that removing core-code without a good reason needs an explanation. Note that not having access rights management and user ownership is not an either or choice. Asking the community in louislam#128 might also be helpful:
TLDR: I think opening an PR and discussing the work plan now (or after further investigation) is a good idea. |
3a40a7c
to
dea4bab
Compare
Yes I know, but you clearly very well knows UK (at least faaaar better than me) and so, with your experience, you act as a first "filter" 🚔
Of course! The explanation is very simple however: following KISS philosophy. I'm trying to provide a very basic multiple admin users support. Since we are speaking about admin users only, they obviously have access to everything. That's why the current resources user-scoping can't be kept.
I kind of agree. But then there is more questions to solve, for example: what happens on user removal? Should we remove all associated resources in cascade? Probably not! So what to do? Transfer ownership to another user? Or perhaps implement user "soft delete" in DB (could be a So many questions... changes... for a so small benefit... at the end I think that the simplest solution is to make resources independent from users. But please keep in mind that my proposal is just a first step in the right direction. I really hope to see enhancements (like ACL and/or RBAC system) in the futur.
I carefully read that issue, the community request is very clear: they want multi users support with rights management (in a way or another). I'm afraid a so open discussion might takes a lot of time because of the huge amount of people waiting for that feature. Because of that, my plan is to start with the very basic approach you know, then,
As you know I have provide my WIP code ASAP because I'm always open to discussion and advise, especially as a new comer on a project 👶🏼 |
867e290
to
f306f5a
Compare
@CommanderStorm could you please take a look on my work? 🙏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the previous two comments. I did mean to include them into this review, but I tried https://github.dev/ (can recomend) for reviewing PRs ^^.
This is a partial review of the code only.
I still need to do a design/UX/functionality-pass respectively.
I am going to the cinema tomorrow evening, so I will get to test this deeper on Wednesday or Thursday.
checkLogin
now should also check for the disabled state of a user- overall, the work quality is excellent. (no obvious defects from a code perspective, no obvious defects from a security perspective)
I don’t know if this will be possible but I have some features you could add
Is ok if I add more features to edit Very good feature, keep it up which to be implemented soon to Uptime Kuma |
Thanks for sharing your enthusiasm and glad to see it please you. |
@CommanderStorm Thanks A LOT for the time you spent reviewing my code. I just add a commit with some of your suggestions. I also reply to others comments with explanations.
But!? You are right! How I could even forgot about that! 🤦🏼♂️
WHAT! You are going to the cinema instead of gracefully reviewing my code!? This is a SCANDAL! 😏😂 NB: Some of my comments might be a bit opinionated, but don't worry: at the end, I will obviously follow this project guidelines 😘 |
2b2a352
to
fcc1fbc
Compare
The tests can be found here: https://github.com/M1CK431/uptime-kuma/tree/add_basic_multiple_admin_users/test/cypress I agree that this project is widely undertested, but this is an important change ⇒ tests for this functionality are an important addition |
fb5db25
to
6836511
Compare
6836511
to
7eb733a
Compare
I agree. I quickly try to understand how to write such test... understand nothing... 🤯 😢 I'm really sorry I will not do it, but I will allow edit from maintainers so if someone wants to add them 🤷🏼♂️
I rework the git commits history to help Louis reviewing then open this PR upstream. Now praying for a merge... 🕯️ 🙏🏼 🕯️ |
7eb733a
to
72ae82d
Compare
72ae82d
to
b53aaa4
Compare
b53aaa4
to
5f06084
Compare
How can I run it? |
Follow regular README instruction 😉 |
I did but I can’t see the new changes I will try again and tell if I could do it |
This is the commands i will run to setup and run it Is it correct?? npm install npm -g git clone https://github.com/M1CK431/uptime-kuma.git |
I guess |
I'm pretty sure you need to follow the development instructions instead of the production ones. |
Can you tell me what is the command because I am getting confused |
add cy login and create admin tests for louislam#3571
Add new edit admins cy tests
Users list:
![image](https://private-user-images.githubusercontent.com/31622263/258648479-d4cf4cc4-56e9-415a-9dae-dc56eaf00bc9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMTg2MzUsIm5iZiI6MTcyMDMxODMzNSwicGF0aCI6Ii8zMTYyMjI2My8yNTg2NDg0NzktZDRjZjRjYzQtNTZlOS00MTVhLTlkYWUtZGM1NmVhZjAwYmM5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDAyMTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEyNGViODQ0ZDA5YWVlZjE4ZTk5YmIyOWRkMGQ3ZTljNzU3ODA0ZTJhNGJkOTRkNzA2M2E4NTgxYzdiM2ExYzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._OodPkZO-E1DlUi_uYRoQl2IMxSK1O7hEYB14rfTI6I)
Confirm modal on disabling user:
![image](https://private-user-images.githubusercontent.com/31622263/260327897-f5802ff0-cfdc-46d0-a54a-903f6f959d8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMTg2MzUsIm5iZiI6MTcyMDMxODMzNSwicGF0aCI6Ii8zMTYyMjI2My8yNjAzMjc4OTctZjU4MDJmZjAtY2ZkYy00NmQwLWE1NGEtOTAzZjZmOTU5ZDhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDAyMTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0MGE4ZjgxOWJhMjFhNjNiOWExN2NjODE5NmY1YWY2OWViMmVhM2Q3MThlZDEzYTQwYTgyNDkyYTg3MTU5ZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.6dzwSjDLbZ5rECfsjL3JuEq7GiMZMwtib2ECzFRqIDw)
Add an admin account:
![image](https://private-user-images.githubusercontent.com/31622263/258648572-ace457ee-db65-44f7-a956-f09777b76087.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMTg2MzUsIm5iZiI6MTcyMDMxODMzNSwicGF0aCI6Ii8zMTYyMjI2My8yNTg2NDg1NzItYWNlNDU3ZWUtZGI2NS00NGY3LWE5NTYtZjA5Nzc3Yjc2MDg3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDAyMTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEyMzJhMDYzZWQ1ZDJkZThmZjRkZjMwZTdhYTQwZmVmMDQ0MTdiNjgyMzNmMjljMzgxZjdmNjNmOTNjMDNjNWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.coiR7Ac31n0xh9vSVa2NuNMHfAnOrYaZiwiohfGZnqQ)
Edit an admin account:
![image](https://private-user-images.githubusercontent.com/31622263/258671647-67090c10-1a10-4e11-ad67-848ff0a7d6f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzMTg2MzUsIm5iZiI6MTcyMDMxODMzNSwicGF0aCI6Ii8zMTYyMjI2My8yNTg2NzE2NDctNjcwOTBjMTAtMWExMC00ZTExLWFkNjctODQ4ZmYwYTdkNmY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDAyMTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFlYzQ5Y2I0NTY1ODMyM2FmMjRjNTM5MGZmNTQ3MTE4N2FhOTBlYjE3NWRlMzI0OThhNTVhNzM2ZmYwMmM2MTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2eWe3AbYKD4Q_4OeGUet195SFZI0vd3sQH2BlnpuulQ)