performant-software / textlab

A collaborative space for creating and publishing digital critical editions.
http://www.textlab.org
GNU General Public License v3.0
13 stars 4 forks source link

New Users are admins by default #170

Closed SteveMarvin closed 7 years ago

SteveMarvin commented 7 years ago

When a new user signs up and is activated by the admin, the new account is set to active by default. However, no user type is assigned. If the admin clicks EDIT and then cancels back out, the type USER is assigned, but if the admin merely activates the user and then logs out, the user is granted SITE ADMIN privs by default. Note that the user type still remains empty until a TEXTLAB ADMIN edits it.

feralresearch commented 7 years ago

@NickLaiacona @SteveMarvin Where in the interface can you edit or see a user's type? I'm logged in as an admin and I can't seem to get it to display, except for http://127.0.0.1:5000/accounts, and in the DB, both show the default type as null.

SteveMarvin commented 7 years ago

You have to be a Textlab admin, not just a site admin.

NickLaiacona commented 7 years ago

should have this admin link in upper right:

screen shot 2017-11-02 at 4 45 47 pm

SteveMarvin commented 7 years ago

Right, then when you edit a user, you will see this dialog:

image

feralresearch commented 7 years ago

Thanks guys, got it... needed to be 'admin' not 'site-admin'

feralresearch commented 7 years ago

Slightly bigger security hole: issue is that users with no role assigned are assumed to be administrators (it's not that admin is assigned, nothing is assigned and 'nothing' grants full access') Fixing...

feralresearch commented 7 years ago

In general we don't check user_type before performing actions. The only check I could find was if the "Admin" link appeared or not, and that appeared for all users who were not of type "user." Users of type NULL or any other type got the admin link, and users of any type can access the functionality by entering the URL.

I can lock this down, but can someone please make me a list of what functionality belongs to each role? Also if these roles are hierarchical (IE should 'admin' grant all 'site_admin' and 'user' and so on).

SteveMarvin commented 7 years ago

New activated users are still admins by default (NULL user type). 👎

SteveMarvin commented 7 years ago

ACCEPTED