<?php
namespace App\Permissions\Modules;

use App\Model\UserTypes;

class Notes extends BasePermissions{

    const NOTES = "NOTES_";
    const NOTES_ADD = self::NOTES."ADD";
    const NOTES_EDIT = self::NOTES."EDIT";
    const NOTES_DELETE = self::NOTES."DELETE";
    const NOTES_VIEW = self::NOTES."VIEW";
    const NOTES_DETAIL_TABS = self::NOTES."DETAIL_TABS";


    public function permissions()
    {
        $permissions =  [
            $permissions =
                [
                    "text"=>"Notes View",
                    "id"=>self::NOTES_VIEW,
                    "state" => $this->selectNodes(self::NOTES_VIEW)
                ],
                [
                    "text"=>"Notes Add",
                    "id"=>self::NOTES_ADD,
                    "state" => $this->selectNodes(self::NOTES_ADD)
                ],
                [
                    "text"=>"Notes Edit",
                    "id"=>self::NOTES_EDIT,
                    "state" => $this->selectNodes(self::NOTES_EDIT)
                ],
                [
                    "text"=>"Notes Delete",
                    "id"=>self::NOTES_DELETE,
                    "state" => $this->selectNodes(self::NOTES_DELETE)
                ]

        ];
        return ["text"=>"NOTES","id"=>self::NOTES,"children"=>$permissions];
    }
    public function frontEndPermissions()
    {
        $notes_permissions = [
            [
                "text"=>"Notes View",
                "ability" => $this->apiPermissionSelected(self::NOTES_VIEW)
            ],
            [
                "text"=>"Notes Add",
                "ability" => $this->apiPermissionSelected(self::NOTES_ADD)
            ],
            [
                "text"=>"Notes Edit",
                "ability" => $this->apiPermissionSelected(self::NOTES_EDIT)
            ],
            [
                "text"=>"Notes Delete",
                "ability" => $this->apiPermissionSelected(self::NOTES_DELETE)
            ]
        ];

        return ["text"=>"Notes Permissions","permissions"=>$notes_permissions];
    }
}
