acl scope data no access to properties
This commit is contained in:
@@ -31,6 +31,7 @@ namespace Espo\Core\Acl;
|
||||
|
||||
use StdClass;
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Scope data.
|
||||
@@ -47,6 +48,11 @@ class ScopeData
|
||||
{
|
||||
}
|
||||
|
||||
public function __get(string $name)
|
||||
{
|
||||
throw new RuntimeException("Accessing ScopeData properties is not allowed.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a raw value.
|
||||
*
|
||||
|
||||
@@ -35,6 +35,7 @@ use Espo\Core\{
|
||||
};
|
||||
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
|
||||
class ScopeDataTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
@@ -135,4 +136,13 @@ class ScopeDataTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$this->assertFalse($data->hasNotNo());
|
||||
}
|
||||
|
||||
public function testAccessingProperty()
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
|
||||
$data = ScopeData::fromRaw(false);
|
||||
|
||||
$data->read;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user