MeiH10 / SDD

GNU General Public License v3.0
0 stars 0 forks source link

Admin API #85

Open mvhutz opened 1 day ago

mvhutz commented 1 day ago

First, add role parameter to mongo schema:

0: banned 1: anonymous user 2: regular user 3: moderator 4: admin

For any endpoint now, change it so:

  1. Go to session service, get account ID.
  2. Go to account service, get Account object.
  3. Check if admin.

For all protected API endpoints, do the above to ensure only authorized people can access these endpoints.