本文整理汇总了PHP中Backend\Core\Engine\Authentication::isAllowedAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::isAllowedAction方法的具体用法?PHP Authentication::isAllowedAction怎么用?PHP Authentication::isAllowedAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend\Core\Engine\Authentication
的用法示例。
在下文中一共展示了Authentication::isAllowedAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadDatagrids
/**
* Loads the dataGrids
*/
private function loadDatagrids()
{
// load all categories
$categories = BackendFaqModel::getCategories(true);
// loop categories and create a dataGrid for each one
foreach ($categories as $categoryId => $categoryTitle) {
$dataGrid = new BackendDataGridDB(BackendFaqModel::QRY_DATAGRID_BROWSE, array(BL::getWorkingLanguage(), $categoryId));
$dataGrid->setAttributes(array('class' => 'dataGrid sequenceByDragAndDrop'));
$dataGrid->setColumnsHidden(array('category_id', 'sequence'));
$dataGrid->addColumn('dragAndDropHandle', null, '<span>' . BL::lbl('Move') . '</span>');
$dataGrid->setColumnsSequence('dragAndDropHandle');
$dataGrid->setColumnAttributes('question', array('class' => 'title'));
$dataGrid->setColumnAttributes('dragAndDropHandle', array('class' => 'dragAndDropHandle'));
$dataGrid->setRowAttributes(array('id' => '[id]'));
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('Edit')) {
$dataGrid->setColumnURL('question', BackendModel::createURLForAction('Edit') . '&id=[id]');
$dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]', BL::lbl('Edit'));
}
// add dataGrid to list
$this->dataGrids[] = array('id' => $categoryId, 'title' => $categoryTitle, 'content' => $dataGrid->getContent());
}
// set empty datagrid
$this->emptyDatagrid = new BackendDataGridArray(array(array('dragAndDropHandle' => '', 'question' => BL::msg('NoQuestionInCategory'), 'edit' => '')));
$this->emptyDatagrid->setAttributes(array('class' => 'dataGrid sequenceByDragAndDrop emptyGrid'));
$this->emptyDatagrid->setHeaderLabels(array('edit' => null, 'dragAndDropHandle' => null));
}
示例2: parse
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// assign the data
$this->tpl->assign('item', $this->record);
$this->tpl->assign('showFaqDeleteCategory', BackendFaqModel::deleteCategoryAllowed($this->id) && BackendAuthentication::isAllowedAction('DeleteCategory'));
}
示例3: loadDataGrid
/**
* Load the datagrid
*/
public function loadDataGrid()
{
$this->dataGrid = new BackendDataGridDB(BackendGroupsModel::QRY_BROWSE);
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('Edit')) {
$this->dataGrid->setColumnURL('name', BackendModel::createURLForAction('Edit') . '&id=[id]');
$this->dataGrid->setColumnURL('num_users', BackendModel::createURLForAction('Edit') . '&id=[id]#tabUsers');
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]');
}
}
示例4: loadDataGrid
/**
* Load the datagrids
*/
private function loadDataGrid()
{
$this->dataGrid = new BackendDataGridDB(BackendContentBlocksModel::QRY_BROWSE, array('active', BL::getWorkingLanguage()));
$this->dataGrid->setSortingColumns(array('title'));
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('Edit')) {
$this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('Edit') . '&id=[id]');
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('Edit') . '&id=[id]', BL::lbl('Edit'));
}
}
示例5: parse
/**
* Parse & display the page
*/
protected function parse()
{
parent::parse();
$this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('AddCategory') && $this->multipleCategoriesAllowed) {
$this->tpl->assign('showAgendaAddCategory', true);
} else {
$this->tpl->assign('showAgendaAddCategory', false);
}
}
示例6: loadDataGrid
/**
* Load the dataGrid
*/
protected function loadDataGrid()
{
$this->dataGrid = new DataGridDB(BackendInstagramModel::QRY_DATAGRID_BROWSE, Language::getWorkingLanguage());
// Reform date
$this->dataGrid->setColumnFunction(array('Backend\\Core\\Engine\\DataGridFunctions', 'getLongDate'), array('[created_on]'), 'created_on', true);
// Check if this action is allowed
if (Authentication::isAllowedAction('Edit')) {
$this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('Edit') . '&id=[id]', Language::lbl('Edit'));
$this->dataGrid->setColumnURL('username', Model::createURLForAction('Edit') . '&id=[id]');
}
}
示例7: loadDataGrid
/**
* Load the dataGrid
*/
private function loadDataGrid()
{
$this->dataGrid = new DataGridDB(BackendBlocksModel::QRY_DATAGRID_BROWSE_CATEGORIES, Language::getWorkingLanguage());
// check if this action is allowed
if (Authentication::isAllowedAction('EditCategory')) {
$this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('EditCategory') . '&id=[id]', Language::lbl('Edit'));
$this->dataGrid->setColumnURL('title', Model::createURLForAction('EditCategory') . '&id=[id]');
}
// sequence
$this->dataGrid->enableSequenceByDragAndDrop();
$this->dataGrid->setAttributes(array('data-action' => 'sequence_categories'));
}
示例8: loadDataGrid
/**
* Load the dataGrid
*/
private function loadDataGrid()
{
$this->dataGrid = new BackendDataGridDB(BackendCatalogModel::QRY_DATAGRID_BROWSE_BRANDS, array(BL::getWorkingLanguage()));
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('EditBrand')) {
$this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('edit_brand') . '&id=[id]');
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('edit_brand') . '&id=[id]', BL::lbl('Edit'));
}
// sequence
$this->dataGrid->enableSequenceByDragAndDrop();
$this->dataGrid->setAttributes(array('data-action' => 'SequenceBrands'));
}
示例9: loadDataGrid
/**
* Load the datagrids
*/
private function loadDataGrid()
{
// create datagrid
$this->dataGrid = new BackendDataGridDB(BackendExtensionsModel::QRY_BROWSE_TEMPLATES, array($this->selectedTheme));
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('EditThemeTemplate')) {
// set colum URLs
$this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('EditThemeTemplate') . '&id=[id]');
// add edit column
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('EditThemeTemplate') . '&id=[id]', BL::lbl('Edit'));
}
}
示例10: parse
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// assign the data
$this->tpl->assign('item', $this->record);
$this->tpl->assign('showFaqDeleteCategory', BackendFaqModel::deleteCategoryAllowed($this->id) && BackendAuthentication::isAllowedAction('DeleteCategory'));
$url = BackendModel::getURLForBlock($this->URL->getModule(), 'Category');
$url404 = BackendModel::getURL(404);
if ($url404 != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
}
示例11: loadDataGrid
/**
* Load the datagrid
*/
protected function loadDataGrid()
{
$this->dataGrid = new BackendDataGridDB(BackendMailengineModel::QRY_DATAGRID_BROWSE_TEMPLATES);
// sorting columns
$this->dataGrid->setSortingColumns(array('title'));
$this->dataGrid->setSortParameter('asc');
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('EditTemplate')) {
$this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('edit_template') . '&id=[id]');
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('edit_template') . '&id=[id]', BL::lbl('Edit'));
}
}
示例12: loadDataGrid
/**
* Load the dataGrid
*/
protected function loadDataGrid()
{
$this->dataGrid = new DataGridDB(BackendBlocksModel::QRY_DATAGRID_BROWSE, Language::getWorkingLanguage());
// reform date
$this->dataGrid->setColumnFunction(array('Backend\\Core\\Engine\\DataGridFunctions', 'getLongDate'), array('[created_on]'), 'created_on', true);
// drag and drop sequencing
$this->dataGrid->enableSequenceByDragAndDrop();
// check if this action is allowed
if (Authentication::isAllowedAction('Edit')) {
$this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('Edit') . '&id=[id]', Language::lbl('Edit'));
$this->dataGrid->setColumnURL('title', Model::createURLForAction('Edit') . '&id=[id]');
}
}
示例13: loadDataGrid
/**
* Loads the datagrids
*/
private function loadDataGrid()
{
// create datagrid
$this->dataGrid = new DataGridDB($this->get('team_repository')->getDataGridQuery(), ['language' => Language::getWorkingLanguage()]);
$this->dataGrid->setColumnFunction(['Rhumsaa\\Uuid\\Uuid', 'fromBytes'], ['[id]'], 'id', true);
$this->dataGrid->setColumnFunction([new DataGridFunctions(), 'getLongDate'], ['[created_on]'], 'created_on', true);
// check if this action is allowed
if (Authentication::isAllowedAction('Edit')) {
// add column
$this->dataGrid->addColumn('edit', null, Language::lbl('Edit'), Model::createURLForAction('Edit'), Language::lbl('Edit'));
$this->dataGrid->setColumnFunction([__CLASS__, 'addIdToEditUrl'], ['[edit]', '[id]'], 'edit', true);
}
$this->tpl->assign('dataGrid', (string) $this->dataGrid->getContent());
}
示例14: loadDataGrid
/**
* Load the datagrid
*/
private function loadDataGrid()
{
$this->dataGrid = new ContentBlockDataGrid(Locale::workingLocale());
$this->dataGrid->setSortingColumns(['title']);
// show the hidden status
$this->dataGrid->addColumn('isHidden', ucfirst(BL::lbl('VisibleOnSite')), '[hidden]');
$this->dataGrid->setColumnFunction([TemplateModifiers::class, 'showBool'], ['[hidden]', true], 'isHidden');
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('Edit')) {
$editUrl = BackendModel::createURLForAction('Edit', null, null, ['id' => '[id]'], false);
$this->dataGrid->setColumnURL('title', $editUrl);
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), $editUrl, BL::lbl('Edit'));
}
}
示例15: checkSettings
/**
* Checks the settings and optionally returns an array with warnings
*
* @return array
*/
public static function checkSettings()
{
$warnings = array();
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('Settings', 'Mailmotor')) {
// analytics session token
if (BackendModel::get('fork.settings')->get('Mailmotor', 'cm_account') == false) {
$warnings[] = array('message' => sprintf(BL::err('AnalysisNoCMAccount', 'Mailmotor'), BackendModel::createURLForAction('Settings', 'Mailmotor')));
} elseif (BackendModel::get('fork.settings')->get('Mailmotor', 'cm_client_id') == '') {
// add warning
$warnings[] = array('message' => sprintf(BL::err('AnalysisNoCMClientID', 'Mailmotor'), BackendModel::createURLForAction('Settings', 'Mailmtor')));
}
}
return $warnings;
}