What is it supposed to do
Fixes the issue with the ban user button sometimes appearing when logged in as a user without ban permissions (user role). This was caused by the user store being saved with the role 'User' in one place, and 'user' in the other. It expects 'User' so I changed it. Also added toUpperCase to the checks to avoid case sensitivity issues like this.
Another thing that was causing issues was the fact that login and login verify were returning the user in different formats. This made the login not save the user's role properly - it would only be saved properly after refreshing (login verify). Now login returns the same format as login verify.
How can we test your branch
The way I was able to recreate this issue was by logging out, visiting a profile page, logging in on your account with default permissions, and then navigating back (with browser) to the page of the user you came from. Hover over the banner to see if the ban user button appears.
1. General checklist
[x] a. Tested happy flow.
[x] b. Tested unhappy flow.
[x] c. No unexpected exceptions.
[x] d. No code with high complexity. (Big O)
[x] e. EOF newline.
[x] f. No linter warnings or errors.
2. If relevant, front-end checklist
[x] a. Responsive. (Desktop all the way to mobile 320px)
[x] b. Using SCSS variables where relevant.
[x] c. Relevant class names
[x] d. No modified global SCSS properties, except if necessary and fully tested the impact.
[x] e. Checked caniuse for more modern CSS properties.
closes #395
What is it supposed to do
Fixes the issue with the ban user button sometimes appearing when logged in as a user without ban permissions (user role). This was caused by the user store being saved with the role 'User' in one place, and 'user' in the other. It expects 'User' so I changed it. Also added toUpperCase to the checks to avoid case sensitivity issues like this.
Another thing that was causing issues was the fact that login and login verify were returning the user in different formats. This made the login not save the user's role properly - it would only be saved properly after refreshing (login verify). Now login returns the same format as login verify.
How can we test your branch
The way I was able to recreate this issue was by logging out, visiting a profile page, logging in on your account with default permissions, and then navigating back (with browser) to the page of the user you came from. Hover over the banner to see if the ban user button appears.
1. General checklist
2. If relevant, front-end checklist
3. If relevant, back-end checklist
4. If relevant, test these browsers