Plant-Tracer / webapp

Client and Server for web-based JavaScript app
GNU Affero General Public License v3.0
0 stars 2 forks source link

super_admin role #575

Open sbarber2 opened 2 weeks ago

sbarber2 commented 2 weeks ago

We currently have the beginnings of support for a role called super_admin.

That is, if a user has a primary_course_id of -1, then they are a super_admin.

The only functionality currently implemented for a super_admin is that on the /audit Audit Logs table, the data presented is across all courses rather than the just the course specified by the users's primary course id. (This is via logic in db.py, specially the get_logs() function.)

To expand the idea of super_admin, the super_admin will be able to do:

simsong commented 2 weeks ago

I don’t recommend it that way. THe super_admin needs to be able to have a primary_course_id. I recommend coding it in the admins table. If they are an admin for course 0, they are the superadmin.

On Oct 14, 2024, at 10:17 AM, Steve Barber @.***> wrote:

We currently have the beginnings of support for a role called super_admin.

That is, if a user has a primary_course_id of -1, then they are a super_admin.

The only functionality currently implemented for a super_admin is that on the /audit Audit Logs table, the data presented is across all courses rather than the just the course specified by the users's primary course id. (This is via logic in db.py, specially the get_logs() function.)

To expand the idea of super_admin, the super_admin will be able to do:

everything a course admin can do, in all courses create a course remove a course add an admin to a course (if we decide course admins can't do this) remove an admin from a course (if we decide course admins can't do this) — Reply to this email directly, view it on GitHub https://github.com/Plant-Tracer/webapp/issues/575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMFHLFIQIJRONRHH7V4RQDZ3PHANAVCNFSM6AAAAABP5DTY7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DMMJZGA2DOMA. You are receiving this because you are subscribed to this thread.

sbarber2 commented 2 weeks ago

I don't recommend using primary_course_id to indicate super_admin-ness, either. That was reportage, not a wish. From db.py:

SUPER_ADMIN_COURSE_ID = -1 # this is the super course. People who are admins in this course see everything.

simsong commented 2 weeks ago

This meant that anyone who was an admin for course -1 was a super admin. it did not need to be their default course ID, I believe. But I could be wrong.

On Oct 14, 2024, at 1:03 PM, Steve Barber @.***> wrote:

I don't recommend it, either. That was reportage, not a wish. From db.py:

SUPER_ADMIN_COURSE_ID = -1 # this is the super course. People who are admins in this course see everything.

— Reply to this email directly, view it on GitHub https://github.com/Plant-Tracer/webapp/issues/575#issuecomment-2411800396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMFHLHLTZLGTCEXDPCIIADZ3P2NZAVCNFSM6AAAAABP5DTY7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJRHAYDAMZZGY. You are receiving this because you commented.

simsong commented 2 weeks ago

Create new super admins? Remove super admin?

On Oct 14, 2024, at 10:17 AM, Steve Barber @.***> wrote:

We currently have the beginnings of support for a role called super_admin.

That is, if a user has a primary_course_id of -1, then they are a super_admin.

The only functionality currently implemented for a super_admin is that on the /audit Audit Logs table, the data presented is across all courses rather than the just the course specified by the users's primary course id. (This is via logic in db.py, specially the get_logs() function.)

To expand the idea of super_admin, the super_admin will be able to do:

everything a course admin can do, in all courses create a course remove a course add an admin to a course (if we decide course admins can't do this) remove an admin from a course (if we decide course admins can't do this) — Reply to this email directly, view it on GitHub https://github.com/Plant-Tracer/webapp/issues/575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMFHLFIQIJRONRHH7V4RQDZ3PHANAVCNFSM6AAAAABP5DTY7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DMMJZGA2DOMA. You are receiving this because you are subscribed to this thread.