forked from baron/baron-sso
4단계 역할 정규화 및 dev 권한 스코프 검증 강화
This commit is contained in:
@@ -44,13 +44,14 @@ func (h *RelyingPartyHandler) ListAll(c *fiber.Ctx) error {
|
||||
|
||||
var rps []domain.RelyingParty
|
||||
var err error
|
||||
role := domain.NormalizeRole(profile.Role)
|
||||
|
||||
if profile.Role == domain.RoleSuperAdmin {
|
||||
if role == domain.RoleSuperAdmin {
|
||||
rps, err = h.Service.ListAll(c.Context())
|
||||
} else if profile.Role == domain.RoleTenantAdmin && profile.TenantID != nil {
|
||||
} else if role == domain.RoleTenantAdmin && profile.TenantID != nil {
|
||||
rps, err = h.Service.List(c.Context(), *profile.TenantID)
|
||||
} else {
|
||||
slog.Warn("Forbidden access to all applications", "userID", profile.ID, "role", profile.Role)
|
||||
slog.Warn("Forbidden access to all applications", "userID", profile.ID, "role", role)
|
||||
return errorJSON(c, fiber.StatusForbidden, "forbidden: insufficient role to list all applications")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user