RezinaLMS-BackEnd/internal/web_server/handlers/team_invitation_guard.go
Yared Yemane df4f4d8ade Limit staff team roles to Super Admin, Admin, and Content Manager.
Add CONTENT_MANAGER RBAC defaults, migration, and Super Admin-only team email invitations; restrict assignable team_member roles without changing platform user roles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 12:01:02 +03:00

18 lines
408 B
Go

package handlers
import (
"Yimaru-Backend/internal/domain"
"github.com/gofiber/fiber/v2"
)
func requireSuperAdminForTeamInvitation(c *fiber.Ctx) error {
role, ok := c.Locals("role").(domain.Role)
if !ok || role != domain.RoleSuperAdmin {
return c.Status(fiber.StatusForbidden).JSON(domain.ErrorResponse{
Message: "Only super administrators can send team email invitations",
})
}
return nil
}