diff --git a/migrations/016-permissions.sql b/migrations/016-permissions.sql new file mode 100644 index 00000000..145eedca --- /dev/null +++ b/migrations/016-permissions.sql @@ -0,0 +1,7 @@ +-- Up + +UPDATE users SET roles = '' WHERE roles = 'user'; + +-- Down + +UPDATE users SET roles = 'user' WHERE roles = ''; diff --git a/server/routes/user.js b/server/routes/user.js index 350f0099..2668b900 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -72,7 +72,7 @@ const fetchOrCreateUser = async (db, user, avatarSource = 'gravatar') => { id: ulid(), username: await defaultUsername(db, user.name || user.email), email: normalise(user.email), - roles: 'user', + roles: '', avatarSource: avatarSource, } await db.get(SQL`INSERT INTO users(id, username, email, roles, avatarSource)