Gc\User\Model::getAcl PHP Method

getAcl() public method

Get User Role
public getAcl ( boolean $forceReload = false ) : Model
$forceReload boolean Force reload
return Gc\User\Role\Model
    public function getAcl($forceReload = false)
    {
        $role = $this->getData('acl');
        if (empty($role) or !empty($forceReload)) {
            $this->setData('acl', new Acl($this));
        }
        return $this->getData('acl');
    }

Usage Example

Example #1
0
 /**
  * Constructor
  *
  * @param UserModel $user User model to retrieve Acl, role name and check permission
  */
 public function __construct(UserModel $user)
 {
     $this->acl = $user->getAcl(true);
     $this->roleName = $user->getRole()->getName();
 }
All Usage Examples Of Gc\User\Model::getAcl