Update
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
namespace Bitrix\Main\UserField\Access\Permission;
|
||||
|
||||
use Bitrix\Main\Access\Permission\AccessPermissionTable;
|
||||
use Bitrix\Main\Entity;
|
||||
use Bitrix\Main\ORM\Fields;
|
||||
use Bitrix\Main\ORM\Query\Query;
|
||||
use Bitrix\Main\ORM\Query\Join;
|
||||
use Bitrix\Main\ORM\Fields\Relations\Reference;
|
||||
use Bitrix\Main\UserAccessTable;
|
||||
@@ -42,23 +43,23 @@ class UserFieldPermissionTable extends AccessPermissionTable
|
||||
public static function getMap()
|
||||
{
|
||||
return [
|
||||
new Entity\IntegerField('ID', [
|
||||
new Fields\IntegerField('ID', [
|
||||
'autocomplete' => true,
|
||||
'primary' => true
|
||||
]),
|
||||
new Entity\IntegerField('ENTITY_TYPE_ID', [
|
||||
new Fields\IntegerField('ENTITY_TYPE_ID', [
|
||||
'required' => true
|
||||
]),
|
||||
new Entity\IntegerField('USER_FIELD_ID', [
|
||||
new Fields\IntegerField('USER_FIELD_ID', [
|
||||
'required' => true
|
||||
]),
|
||||
new Entity\StringField('ACCESS_CODE', [
|
||||
new Fields\StringField('ACCESS_CODE', [
|
||||
'required' => true
|
||||
]),
|
||||
new Entity\StringField('PERMISSION_ID', [
|
||||
new Fields\StringField('PERMISSION_ID', [
|
||||
'required' => true
|
||||
]),
|
||||
new Entity\IntegerField('VALUE', [
|
||||
new Fields\IntegerField('VALUE', [
|
||||
'required' => true
|
||||
]),
|
||||
(new Reference(
|
||||
@@ -131,7 +132,7 @@ class UserFieldPermissionTable extends AccessPermissionTable
|
||||
*/
|
||||
public static function getUserFieldsAccessCodes(int $entityTypeID): array
|
||||
{
|
||||
$query = new Entity\Query(self::getEntity());
|
||||
$query = new Query(self::getEntity());
|
||||
$query->addSelect('USER_FIELD.FIELD_NAME', 'FIELD_NAME');
|
||||
$query->addSelect('ACCESS_CODE');
|
||||
$query->addSelect('USER_ACCESS.USER_ID', 'USER_ID');
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Bitrix\Main\UserField\Internal;
|
||||
use Bitrix\Main\Application;
|
||||
use Bitrix\Main\DB\MssqlConnection;
|
||||
use Bitrix\Main\DB\SqlQueryException;
|
||||
use Bitrix\Main\Entity\Validator\RegExp;
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
use Bitrix\Main\ORM\Data\DataManager;
|
||||
use Bitrix\Main\ORM\Entity;
|
||||
@@ -18,6 +17,7 @@ use Bitrix\Main\ORM\Fields\Field;
|
||||
use Bitrix\Main\ORM\Fields\IntegerField;
|
||||
use Bitrix\Main\ORM\Fields\Relations\Reference;
|
||||
use Bitrix\Main\ORM\Fields\StringField;
|
||||
use Bitrix\Main\ORM\Fields\Validators\RegExpValidator;
|
||||
use Bitrix\Main\ORM\Query\Query;
|
||||
use Bitrix\Main\SystemException;
|
||||
use Bitrix\Main\Text\StringHelper;
|
||||
@@ -42,7 +42,7 @@ abstract class TypeDataManager extends DataManager
|
||||
->configureUnique()
|
||||
->configureSize(100)
|
||||
->configureFormat('/^[A-Z][A-Za-z0-9]*$/')
|
||||
->addValidator(new RegExp(
|
||||
->addValidator(new RegExpValidator(
|
||||
'/(?<!Table)$/i'
|
||||
)),
|
||||
(new StringField('TABLE_NAME'))
|
||||
@@ -546,4 +546,4 @@ abstract class TypeDataManager extends DataManager
|
||||
{
|
||||
return Type::class;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user