<?php
namespace Claromentis\Orgchart;

$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] ?: array()) + array("_18dab35f5768d" . "09db81c56070e0" . "4f534" => base64_decode("b3JnX2NoYXJ0X2RlcGFy" . "dG1lbnQuaWQ="), "p" => base64_decode("cA=" . "="), "_5630a508eaf62fdbab410362fa1773" . "5c" => base64_decode("cGVybW" . "lzc2lv" . "bnM="), "_98b8bed5" . "ac8433501" . "6322c4018" . "73c3d4" => base64_decode("UGVybUNoZWNrQXNUd2" . "9TUUw="), "_4d707fab93bebb" . "00bbe69e8159697" . "c90" => base64_decode(""), "_70935e7f47a44a86b" . "6b20eba2ee1fba0" => base64_decode("b3JnX2NoYXJ0X2RlcGFydG" . "1lbnQ="));
use Claromentis\Core\Acl\AclRepository;
use Claromentis\Core\DAL;
use Claromentis\Core\Security\SecurityContext;




class OrgchartAcl
{
    protected $acl_repository;
    protected $url_repo;
    protected $pages_repo;
    public function __construct(AclRepository $acl, OrgchartRepository $_0bb8bac53757cffec6387614650ed2d8)
    {
        $this->acl_repository = $acl;
        $this->orgchart_repository = $_0bb8bac53757cffec6387614650ed2d8;
    }
    public function CanViewOrgchart(SecurityContext $context, $_e9592f9765722975cdfa9db51be4cc76)
    {
        return $this->acl_repository->Permits($context, Perm::PERM_VIEW, Perm::CLASS_ORGCHART, $_e9592f9765722975cdfa9db51be4cc76);
    }
    public function CanCreateEditOrgchart(SecurityContext $context)
    {
        return $this->acl_repository->Permits($context, Perm::PERM_MANAGE, Perm::CLASS_ORGCHART_ADMIN, 1);
    }
    public function CanDeleteOrgchart(SecurityContext $context, $id)
    {
        return $this->acl_repository->Permits($context, Perm::PERM_MANAGE, Perm::CLASS_ORGCHART_ADMIN, 1);
    }
    public function ApplySitesPermissions(SecurityContext $context, DAL\QueryBuilder $_4c8189237e0d0b5cd82c06d69613c88e, $rights = Perm::PERM_VIEW)
    {
        list($_bdfba04e3e7f4c28fa5e00cda2d66752, $_c7598a9614976977e540b17c67707384) = $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_98b8bed5ac84335016322c401873c" . "3d4"](Perm::CLASS_ORGCHART, $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_18dab35f5768d0" . "9db81c56070e04f" . "534"], $rights, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_4d707fab" . "93bebb00b" . "be69e8159" . "697c90"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["p"]);
        
        
        $_4c8189237e0d0b5cd82c06d69613c88e->AddJoin($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_70935e7" . "f47a44a8" . "6b6b20eb" . "a2ee1fba" . "0"], $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_5630a508eaf62fdbab410362fa17735" . "c"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["p"], $_bdfba04e3e7f4c28fa5e00cda2d66752);
        $_4c8189237e0d0b5cd82c06d69613c88e->AddWhereAndClause($_c7598a9614976977e540b17c67707384);
    }
}