public function can($name)
    {
        foreach ($this->permissions as $permission) {
            if ($permission->name == $name || $permission->id == $name) {
                return true;
            }
        }

        return false;
    }
public function can($name)
    {
        foreach ($this->permissions as $permission) {
            if ($permission->name == $name || $permission->id == $name) {
                return true;
            }
        }

        return false;
    }
public function can ( $ name ) { foreach ( $ this -> permissions as $ permission ) { if ( $ permission -> name == $ name || $ permission -> id == $ name ) { return true ; } } return false ; }
Determine wether the current role has permission that given by name parameter.

@param string $name

@return bool
Determine wether the current role has permission that given by name parameter .