AjobK / Seaqull

Seaqull programming blog
http://www.seaqull.com
3 stars 0 forks source link

388 hotfix ban user visible #396

Closed jerohero closed 2 years ago

jerohero commented 2 years ago

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