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>
18 lines
408 B
Go
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
|
|
}
|