acl scope data no access to properties

This commit is contained in:
Yuri Kuznetsov
2021-04-06 12:15:28 +03:00
parent 62d2157fd8
commit c6f95a9030
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -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;
}
}