feat: Implement module-based access control system with integrated authentication, authorization, and security utilities.

This commit is contained in:
Furqan-14
2026-02-02 17:33:35 +05:30
parent 249e03aa95
commit 7c326dea94
51 changed files with 2329 additions and 499 deletions
-27
View File
@@ -1,27 +0,0 @@
import sys
import os
from sqlalchemy import text
# Add parent directory to path so we can import app
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from app.config.database import engine
def fix_alembic_version():
target_version = '8acd83604252'
print(f"Attempting to reset alembic_version to {target_version}...")
try:
with engine.begin() as conn:
# Check if table exists
conn.execute(text("DROP TABLE IF EXISTS alembic_version"))
conn.execute(text("CREATE TABLE alembic_version (version_num VARCHAR(32) NOT NULL)"))
conn.execute(text(f"INSERT INTO alembic_version (version_num) VALUES ('{target_version}')"))
print("Successfully checked/created alembic_version table and inserted target version.")
except Exception as e:
print(f"Error: {e}")
sys.exit(1)
if __name__ == "__main__":
fix_alembic_version()
+5
View File
@@ -47,6 +47,11 @@ PREDEFINED_ACCESSES = [
("superadmin.palette.update", "Superadmin", "Allow access to update color palettes", None),
("superadmin.palette.delete", "Superadmin", "Allow access to delete color palettes", None),
# Module Registry
("modules.view", "Superadmin", "Allow access to view module registry", None),
("modules.manage", "Superadmin", "Allow access to manage modules", None),
("tenants.manage", "Superadmin", "Allow access to manage tenant module assignments", None),
# All Accesses hereafter are applicable for a Tenant Admin
# Administration category