PHP code example of geniv / nette-identity-acl

1. Go to this page and download the library: Download geniv/nette-identity-acl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geniv / nette-identity-acl example snippets


protected function createComponentRoleForm(RoleForm $roleForm): RoleForm
{
    //$roleForm->setTemplatePath(path);
    //$roleForm->onSuccess[] = function (Form $form, array $values) { };
    //$roleForm->onError[] = function (Form $form) { };
    return $roleForm;
}


protected function createComponentResourceForm(ResourceForm $resourceForm): ResourceForm
{
    //$resourceForm->setTemplatePath(path);
    //$resourceForm->onSuccess[] = function (Form $form, array $values) { };
    //$resourceForm->onError[] = function (Form $form) { };
    return $resourceForm;
}


protected function createComponentPrivilegeForm(PrivilegeForm $privilegeForm): PrivilegeForm
{
    //$privilegeForm->setTemplatePath(path);
    //$privilegeForm->onSuccess[] = function (Form $form, array $values) { };
    //$privilegeForm->onError[] = function (Form $form) { };
    return $privilegeForm;
}


protected function createComponentAclForm(AclForm $aclForm, AclFormContainer $aclFormContainer, IIdentityAuthorizator $identityAuthorizator): AclForm
{
    //$aclFormContainer->onRender = function ($data) { return $data; };
    //$aclFormContainer->setMultiSelect(true);

//    $this['aclForm']['form']->setDefaults($this['aclForm']->getDefaults($id));
//    $this['aclForm']['form']->setDefaults($identityAuthorizator->getAclForm($id));

    //$aclForm->setTemplatePath(path);
    //$aclForm->onSuccess[] = function (Form $form, array $values) use ($aclForm) { $aclForm->saveAcl(array $values) };
    //$aclForm->onError[] = function (Form $form) { };
    return $aclForm;
}
json
"php": ">=7.0",
"nette/application": ">=2.4",
"nette/utils": ">=2.4",
"geniv/nette-general-form": ">=1.0",
"geniv/nette-identity-authorizator": ">=1.0"