fablabbcn / smartcitizen-api

The Smart Citizen Engine
https://developer.smartcitizen.me
GNU Affero General Public License v3.0
10 stars 4 forks source link

Review role_mask checks #242

Closed oscgonfer closed 1 year ago

oscgonfer commented 1 year ago

As checked by @timcowlishaw , wt seems we currently do not set the role properly based on this function!

https://github.com/fablabbcn/smartcitizen-api/blob/fca48fe8967fd9ad4153889c5296f220aee1c0c5/app/models/user.rb#L108-L111

timcowlishaw commented 1 year ago

Hey Oscar, Apologies, i've forgotten the expected behaviour here!

Currently it'd be:

Role mask Role
0 citizen
1 citizen
2 researcher
3 citizen
4 citizen
5 admin
6 etc admin
I'm guessing an easy choice to 'rationalise' it would be: Role mask Role
0 citizen
1 citizen
2 researcher
3 researcher
4 researcher
5 admin
6 etc admin

is that what you wanted to happen?

oscgonfer commented 1 year ago

Hi! Yes, the second table would be the correct one. Note for the future: we will have to review this table. We literally do not need so many categories, specially above admin, but functionality-wise this works.

timcowlishaw commented 1 year ago

ok great, I'll have a look at that now!