本文整理汇总了PHP中UserGroup::GetPermissionsForObject方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::GetPermissionsForObject方法的具体用法?PHP UserGroup::GetPermissionsForObject怎么用?PHP UserGroup::GetPermissionsForObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::GetPermissionsForObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPermissions
public function GetPermissions($objectId)
{
$userGroup = new UserGroup();
if (!($result = $userGroup->GetPermissionsForObject('lkcampaigngroup', 'CampaignID', $objectId))) {
return $this->SetError($userGroup->GetErrorMessage());
}
return $result;
}
示例2: ListSecurity
public function ListSecurity($dataSetId, $groupId)
{
if ($dataSetId == 0 || $dataSetId == '') {
return $this->SetError(25001, __('Missing dataSetId'));
}
$userGroup = new UserGroup();
if (!($result = $userGroup->GetPermissionsForObject('lkdatasetgroup', 'DataSetID', $dataSetId))) {
return $this->SetError($userGroup->GetErrorMessage());
}
$security = array();
foreach ($result as $row) {
$security[] = array('groupid' => Kit::ValidateParam($row['groupid'], _INT), 'group' => Kit::ValidateParam($row['group'], _STRING), 'view' => Kit::ValidateParam($row['view'], _INT), 'edit' => Kit::ValidateParam($row['edit'], _INT), 'del' => Kit::ValidateParam($row['del'], _INT), 'isuserspecific' => Kit::ValidateParam($row['isuserspecific'], _INT));
}
return $security;
}
示例3: PermissionsForm
/**
* Permissions form
*/
public function PermissionsForm()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$helpManager = new HelpManager($db, $user);
if (!$this->auth->modifyPermissions) {
trigger_error(__('You do not have permissions to edit this media'), E_USER_ERROR);
}
// List of all Groups with a view / edit / delete check box
$permissions = new UserGroup();
if ($this->assignedMedia) {
if (!($result = $permissions->GetPermissionsForObject('lklayoutmediagroup', NULL, NULL, sprintf(" AND lklayoutmediagroup.MediaID = '%s' AND lklayoutmediagroup.RegionID = '%s' AND lklayoutmediagroup.LayoutID = %d ", $this->mediaid, $this->regionid, $this->layoutid)))) {
trigger_error($permissions->GetErrorMessage(), E_USER_ERROR);
}
} else {
if (!($result = $permissions->GetPermissionsForObject('lkmediagroup', 'MediaID', $this->mediaid))) {
trigger_error($permissions->GetErrorMessage(), E_USER_ERROR);
}
}
if (count($result) <= 0) {
trigger_error(__('Unable to get permissions'), E_USER_ERROR);
}
$checkboxes = array();
foreach ($result as $row) {
$groupId = $row['groupid'];
$rowClass = $row['isuserspecific'] == 0 ? 'strong_text' : '';
$checkbox = array('id' => $groupId, 'name' => Kit::ValidateParam($row['group'], _STRING), 'class' => $rowClass, 'value_view' => $groupId . '_view', 'value_view_checked' => $row['view'] == 1 ? 'checked' : '', 'value_edit' => $groupId . '_edit', 'value_edit_checked' => $row['edit'] == 1 ? 'checked' : '', 'value_del' => $groupId . '_del', 'value_del_checked' => $row['del'] == 1 ? 'checked' : '');
$checkboxes[] = $checkbox;
}
$formFields = array();
$formFields[] = FormManager::AddPermissions('groupids[]', $checkboxes);
Theme::Set('form_fields', $formFields);
// Set some information about the form
Theme::Set('form_id', 'LayoutPermissionsForm');
Theme::Set('form_action', 'index.php?p=module&mod=' . $this->type . '&q=Exec&method=Permissions');
Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $this->layoutid . '" /><input type="hidden" name="regionid" value="' . $this->regionid . '" /><input type="hidden" name="mediaid" value="' . $this->mediaid . '" />');
$response->SetFormRequestResponse(NULL, __('Permissions'), '350px', '500px');
$response->AddButton(__('Help'), 'XiboHelpRender("' . ($this->layoutid != 0 ? $helpManager->Link('LayoutMedia', 'Permissions') : $helpManager->Link('Media', 'Permissions')) . '")');
if ($this->assignedMedia) {
$response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '®ionid=' . $this->regionid . '&q=RegionOptions")');
} else {
$response->AddButton(__('Cancel'), 'XiboDialogClose()');
}
$response->AddButton(__('Save'), '$("#LayoutPermissionsForm").submit()');
return $response;
}
示例4: PermissionsForm
/**
* Show the Permissions for this Display Group
*/
public function PermissionsForm()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$helpManager = new HelpManager($db, $user);
$displayGroupId = Kit::GetParam('DisplayGroupID', _GET, _INT);
$auth = $this->user->DisplayGroupAuth($displayGroupId, true);
if (!$auth->modifyPermissions) {
trigger_error(__('You do not have permissions to edit this display group'), E_USER_ERROR);
}
// Set some information about the form
Theme::Set('form_id', 'DisplayGroupPermissionsForm');
Theme::Set('form_action', 'index.php?p=displaygroup&q=Permissions');
Theme::Set('form_meta', '<input type="hidden" name="displayGroupId" value="' . $displayGroupId . '" />');
// List of all Groups with a view / edit / delete check box
$permissions = new UserGroup();
if (!($result = $permissions->GetPermissionsForObject('lkdisplaygroupgroup', 'DisplayGroupID', $displayGroupId))) {
trigger_error($permissions->GetErrorMessage(), E_USER_ERROR);
}
if (count($result) <= 0) {
trigger_error(__('Unable to get permissions for this Display Group'), E_USER_ERROR);
}
$checkboxes = array();
foreach ($result as $row) {
$groupId = $row['groupid'];
$rowClass = $row['isuserspecific'] == 0 ? 'strong_text' : '';
$checkbox = array('id' => $groupId, 'name' => Kit::ValidateParam($row['group'], _STRING), 'class' => $rowClass, 'value_view' => $groupId . '_view', 'value_view_checked' => $row['view'] == 1 ? 'checked' : '', 'value_edit' => $groupId . '_edit', 'value_edit_checked' => $row['edit'] == 1 ? 'checked' : '', 'value_del' => $groupId . '_del', 'value_del_checked' => $row['del'] == 1 ? 'checked' : '');
$checkboxes[] = $checkbox;
}
$formFields = array();
$formFields[] = FormManager::AddPermissions('groupids[]', $checkboxes);
Theme::Set('form_fields', $formFields);
$response->SetFormRequestResponse(NULL, __('Permissions'), '350px', '500px');
$response->AddButton(__('Help'), 'XiboHelpRender("' . HelpManager::Link('DisplayGroup', 'Permissions') . '")');
$response->AddButton(__('Cancel'), 'XiboDialogClose()');
$response->AddButton(__('Save'), '$("#DisplayGroupPermissionsForm").submit()');
$response->Respond();
}
示例5: RegionPermissionsForm
public function RegionPermissionsForm()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$helpManager = new HelpManager($db, $user);
$layoutid = Kit::GetParam('layoutid', _GET, _INT);
$regionid = Kit::GetParam('regionid', _GET, _STRING);
Kit::ClassLoader('region');
$region = new region($db);
$ownerId = $region->GetOwnerId($layoutid, $regionid);
$regionAuth = $this->user->RegionAssignmentAuth($ownerId, $layoutid, $regionid, true);
if (!$regionAuth->modifyPermissions) {
trigger_error(__("You do not have permissions to edit this regions permissions"), E_USER_ERROR);
}
// List of all Groups with a view / edit / delete check box
$permissions = new UserGroup();
if (!($result = $permissions->GetPermissionsForObject('lklayoutregiongroup', NULL, NULL, sprintf(" AND lklayoutregiongroup.LayoutID = %d AND lklayoutregiongroup.RegionID = '%s' ", $layoutid, $regionid)))) {
trigger_error($permissions->GetErrorMessage(), E_USER_ERROR);
}
if (count($result) <= 0) {
trigger_error(__('Unable to get permissions'), E_USER_ERROR);
}
$checkboxes = array();
foreach ($result as $row) {
$groupId = $row['groupid'];
$rowClass = $row['isuserspecific'] == 0 ? 'strong_text' : '';
$checkbox = array('id' => $groupId, 'name' => Kit::ValidateParam($row['group'], _STRING), 'class' => $rowClass, 'value_view' => $groupId . '_view', 'value_view_checked' => $row['view'] == 1 ? 'checked' : '', 'value_edit' => $groupId . '_edit', 'value_edit_checked' => $row['edit'] == 1 ? 'checked' : '', 'value_del' => $groupId . '_del', 'value_del_checked' => $row['del'] == 1 ? 'checked' : '');
$checkboxes[] = $checkbox;
}
$formFields = array();
$formFields[] = FormManager::AddPermissions('groupids[]', $checkboxes);
Theme::Set('form_fields', $formFields);
// Set some information about the form
Theme::Set('form_id', 'RegionPermissionsForm');
Theme::Set('form_action', 'index.php?p=timeline&q=RegionPermissions');
Theme::Set('form_meta', '<input type="hidden" name="layoutid" value="' . $layoutid . '" /><input type="hidden" name="regionid" value="' . $regionid . '" />');
$response->SetFormRequestResponse(NULL, __('Permissions'), '350px', '500px');
$response->AddButton(__('Help'), 'XiboHelpRender("' . $helpManager->Link('Region', 'Permissions') . '")');
$response->AddButton(__('Cancel'), 'XiboDialogClose()');
$response->AddButton(__('Save'), '$("#RegionPermissionsForm").submit()');
$response->Respond();
}