[英]Restrict output of typo3 extbase backend module
I wrote a backendmodule with extbase in typo3 4.5
and I would like to show different extbase models for different usergroups, but I don't know how. 我在
typo3 4.5
中用extbase写了一个后端模块,我想为不同的用户组显示不同的extbase模型,但是我不知道如何。 My idea was to register one backendmodul per usergroup, but i think its too laborious. 我的想法是为每个用户组注册一个backendmodul,但我认为这太费力了。 I don't want to check the user group and their rights in my extension.
我不想在我的扩展程序中检查用户组及其权限。 Is there a way to get this?
有办法吗?
Example: 例:
models | usergroup: editor could see
specific models | usergroup: specific_editor could see
Please explain the scenario in details. 请详细说明该方案。 From this i can say this is possible .
由此我可以说这是可能的。 All you do see to check the user group and according to this you can create a switchable actions in your controller .
您所看到的全部内容都是检查用户组,并据此可以在控制器中创建可切换的动作。
在扩展程序管理器中有几个复选框-扩展程序配置选项卡,您可以在扩展程序中选择用户组及其权限吗?
I try to show different extbase-model-entries to different users in my own backend-modul. 我尝试在自己的后端模块中向不同的用户显示不同的extbase-model条目。 For example user 'editor' only see 'entry1' and 'special_editor' see 'entry2' and 'entry3'.
例如,用户“ editor”仅看到“ entry1”和“ special_editor”看到“ entry2”和“ entry3”。 My idea was to extend the usergroup tca and add a selectfield for my models.
我的想法是扩展用户组tca并为模型添加选择域。 My backend-modul will check the current backenduser to get his usergroup and than i want to check the assigned model.
我的后端模块将检查当前的后端用户以获取他的用户组,然后我要检查分配的模型。 It seems to be laborious, but i think its the best and the only way.
这似乎很费力,但我认为这是最好也是唯一的方法。
I get one solution: 我得到一个解决方案:
At first i add a field to be_users. 首先,我向be_users添加一个字段。
$tempColumns = array(
'model' => array(
'exclude' => 0,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:extensionResources/Private/Language/locallang_db.xml:tx_extension_domain_model_ownmodel',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_extension_domain_model_ownmodel',
'size' => 10,
'width' => 20,
'minitems' => 0,
'maxitems' => 9999,
'allowNonIdValues' => 0,
'eval' => 'required',
),
),
);
t3lib_div::loadTCA('be_users');
t3lib_extMgm::addTCAcolumns('be_users',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('be_users','model;;;;1-1-1');
in my backend-modul i check the current backenduser 在我的后端模块中,我检查当前的后端用户
$GLOBALS['BE_USER']->user['model']
so i get a list of my modelids separated by commas. 所以我得到了用逗号分隔的我的modelid列表。
thats it. 而已。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.