1. Go to this page and download the library: Download mrjulio/rapture-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/ */
mrjulio / rapture-acl example snippets
class User implements \Rapture\Acl\Definition\RequesterInterface
{
/**
* @return array
*/
public function requesterGroups()
{
return ['admin'];
}
/**
* @return int
*/
public function requesterId()
{
return $this->id;
}
}
class Model implements \Rapture\Acl\Definition\ResourceInterface
{
/**
* @return array
*/
public function resourceGroups()
{
return ['models'];
}
/**
* @return string|int
*/
public function resourceId()
{
return $this->getId();
}
/**
* @return int
*/
public function ownerId()
{
return $this->getCreatedBy();
}
}