N°6251 - 1:n - Actions must not be proposed to user not allowed (#491)

This commit is contained in:
bdalsass
2023-05-05 14:28:37 +02:00
committed by GitHub
parent d10e2ac25a
commit b9cfb62d1a
5 changed files with 178 additions and 107 deletions

View File

@@ -18,6 +18,7 @@ use DictExceptionMissingString;
use DisplayBlock;
use Exception;
use MySQLException;
use UserRights;
use Utils;
use WebPage;
@@ -71,6 +72,11 @@ abstract class AbstractBlockLinkSetViewTable extends UIContentBlock
protected string $sTableId;
// User rights
protected bool $bIsAllowCreate;
protected bool $bIsAllowModify;
protected bool $bIsAllowDelete;
/**
* Constructor.
*
@@ -110,6 +116,11 @@ abstract class AbstractBlockLinkSetViewTable extends UIContentBlock
private function Init()
{
$this->sTargetClass = $this->GetTargetClass();
// User rights
$this->bIsAllowCreate = UserRights::IsActionAllowed($this->oAttDef->GetLinkedClass(), UR_ACTION_CREATE) == UR_ALLOWED_YES;
$this->bIsAllowModify = UserRights::IsActionAllowed($this->oAttDef->GetLinkedClass(), UR_ACTION_MODIFY) == UR_ALLOWED_YES;
$this->bIsAllowDelete = UserRights::IsActionAllowed($this->oAttDef->GetLinkedClass(), UR_ACTION_DELETE) == UR_ALLOWED_YES;
}