<?php

namespace App\Enums;

enum UserRole: string
{
    case SuperAdmin = 'super_admin';
    case Admin = 'admin';
    case Editor = 'editor';

    public function label(): string
    {
        return match ($this) {
            self::SuperAdmin => 'Super administrateur',
            self::Admin => 'Administrateur',
            self::Editor => 'Éditeur',
        };
    }

    public function canPublish(): bool
    {
        return $this !== self::Editor;
    }

    public function canManageUsers(): bool
    {
        return $this === self::SuperAdmin;
    }
}
