<?php
namespace App\Permissions\Modules;

use App\Model\UserTypes;

class LabKit extends BasePermissions{

    const LABKIT = "LABKIT_";
    const LABKIT_ADD = self::LABKIT."ADD";
    const LABKIT_VIEW = self::LABKIT."VIEW";
    const LABKIT_EDIT = self::LABKIT."EDIT";
    const LABKIT_DELETE = self::LABKIT."DELETE";
    const LABKIT_DETAIL = self::LABKIT."DETAIL";

    public function permissions()
    {
        $permissions =  [
            [
                "text"=>"LabKit Add",
                "id"=>self::LABKIT_ADD,
                "state" => $this->selectNodes(self::LABKIT_ADD)
            ],
            [
                "text"=>"LabKit View",
                "id"=>self::LABKIT_VIEW,
                "state" => $this->selectNodes(self::LABKIT_VIEW)
            ],
            [
                "text"=>"LabKit Edit",
                "id"=>self::LABKIT_EDIT,
                "state" => $this->selectNodes(self::LABKIT_EDIT)
            ],
            [
                "text"=>"LabKit Delete",
                "id"=>self::LABKIT_DELETE,
                "state" => $this->selectNodes(self::LABKIT_DELETE)
            ],
            [
                "text"=>"LabKit Detail",
                "id"=>self::LABKIT_DETAIL,
                "state" => $this->selectNodes(self::LABKIT_DETAIL)
            ]
        ];
        return ["text"=>"LabKit","id"=>self::LABKIT,"children"=>$permissions];
    }
    public function frontEndPermissions()
    {
        $labkit_permissions = [
            [
                "text"=>"LabKit Add",
                "ability" => $this->apiPermissionSelected(self::LABKIT_ADD)
            ],
            [
                "text"=>"LabKit View",
                "ability" => $this->apiPermissionSelected(self::LABKIT_VIEW)
            ],
            [
                "text"=>"LabKit Edit",
                "ability" => $this->apiPermissionSelected(self::LABKIT_EDIT)
            ],
            [
                "text"=>"LabKit Delete",
                "ability" => $this->apiPermissionSelected(self::LABKIT_DELETE)
            ],
            [
                "text"=>"LabKit Detail",
                "ability" => $this->apiPermissionSelected(self::LABKIT_DETAIL)
            ]
        ];

        return ["text"=>"LabKit Permissions","permissions"=>$labkit_permissions];
    }
}
