Fix superadmin access control and modal aria-hidden warning
- Implement role normalization system to handle role name variants (superadmin, super_admin, administrator) - Add session persistence configuration (PERMANENT_SESSION_LIFETIME = 7 days) - Add modules JSON column to users database table schema - Update setup script with backward compatibility check for modules column - Fix user_management_simple route to properly fetch and display modules - Resolve modal aria-hidden accessibility warning by managing focus on close button - All changes deployed and tested successfully
This commit is contained in:
@@ -383,12 +383,21 @@ def create_users_table_mariadb():
|
||||
username VARCHAR(100) UNIQUE NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
role VARCHAR(50) NOT NULL,
|
||||
modules JSON DEFAULT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
"""
|
||||
cursor.execute(users_table_query)
|
||||
print_success("Table 'users' created successfully")
|
||||
|
||||
# Ensure modules column exists (for backward compatibility with existing tables)
|
||||
try:
|
||||
cursor.execute("SELECT modules FROM users LIMIT 1")
|
||||
except mariadb.ProgrammingError:
|
||||
# Column doesn't exist, add it
|
||||
cursor.execute("ALTER TABLE users ADD COLUMN modules JSON DEFAULT NULL")
|
||||
print_success("Added 'modules' column to existing 'users' table")
|
||||
|
||||
# Create roles table in MariaDB
|
||||
roles_table_query = """
|
||||
CREATE TABLE IF NOT EXISTS roles (
|
||||
|
||||
Reference in New Issue
Block a user