Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
129c849
1
Parent(s): bb024df
backend stabilisation
Browse files- core/deps.py +3 -5
core/deps.py
CHANGED
|
@@ -171,15 +171,13 @@ async def get_current_user_from_token(token: str, db: AsyncSession, portal: Opti
|
|
| 171 |
if ws_id: merged_user.workspace_id = ws_id
|
| 172 |
if active_role: merged_user.role = active_role
|
| 173 |
|
| 174 |
-
# Shim for platform admin check
|
|
|
|
| 175 |
from models.user import UserRole
|
| 176 |
role_str = str(merged_user.role).lower()
|
| 177 |
setattr(merged_user, "is_platform_admin", (
|
| 178 |
role_str == "superadmin" or
|
| 179 |
-
merged_user.
|
| 180 |
-
merged_user.global_role == UserRole.SUPERADMIN or
|
| 181 |
-
merged_user.role == UserRole.SC_ADMIN or
|
| 182 |
-
merged_user.role == UserRole.SC_LEAD
|
| 183 |
))
|
| 184 |
|
| 185 |
# --- STRICT PORTAL ISOLATION (Backend Guard) ---
|
|
|
|
| 171 |
if ws_id: merged_user.workspace_id = ws_id
|
| 172 |
if active_role: merged_user.role = active_role
|
| 173 |
|
| 174 |
+
# Shim for platform admin check: Strictly restricted to Global Superadmins.
|
| 175 |
+
# Regular 3SC Leads and Admins must operate within their assigned workspace associations.
|
| 176 |
from models.user import UserRole
|
| 177 |
role_str = str(merged_user.role).lower()
|
| 178 |
setattr(merged_user, "is_platform_admin", (
|
| 179 |
role_str == "superadmin" or
|
| 180 |
+
merged_user.global_role == UserRole.SUPERADMIN
|
|
|
|
|
|
|
|
|
|
| 181 |
))
|
| 182 |
|
| 183 |
# --- STRICT PORTAL ISOLATION (Backend Guard) ---
|