<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ClientAdminPermission extends Model
{
    use HasFactory;

    protected $fillable = [
        'client_admin_id',
        'permission_key',
        'is_allowed',
    ];

    protected $casts = [
        'is_allowed' => 'boolean',
    ];

    /**
     * Get the client admin that owns this permission override.
     */
    public function clientAdmin()
    {
        return $this->belongsTo(ClientAdmin::class);
    }
}
