本文整理汇总了PHP中Ticket::haveAGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::haveAGroup方法的具体用法?PHP Ticket::haveAGroup怎么用?PHP Ticket::haveAGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::haveAGroup方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: canUpdateItem
/**
* Is the current user have right to update the current satisfaction
*
* @return boolean
**/
function canUpdateItem()
{
$ticket = new Ticket();
if (!$ticket->getFromDB($this->fields['tickets_id'])) {
return false;
}
// you can't change if your answer > 12h
if (!is_null($this->fields['date_answered']) && strtotime("now") - strtotime($this->fields['date_answered']) > 12 * HOUR_TIMESTAMP) {
return false;
}
if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID()) || $ticket->fields["users_id_recipient"] === Session::getLoginUserID() || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION["glpigroups"])) {
return true;
}
return false;
}
示例2: canUpdateItem
/**
* Is the current user have right to update the current followup ?
*
* @return boolean
**/
function canUpdateItem()
{
if ($this->fields["users_id"] != Session::getLoginUserID() && !Session::haveRight(self::$rightname, self::UPDATEALL)) {
return false;
}
$ticket = new Ticket();
if (!$ticket->can($this->getField('tickets_id'), READ)) {
return false;
}
if ($this->fields["users_id"] === Session::getLoginUserID() && Session::haveRight(self::$rightname, self::UPDATEMY)) {
return true;
}
// Only the technician
return Session::haveRight(self::$rightname, self::UPDATEALL) || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']);
}
示例3: canCreateItem
/**
* Is the current user have right to create the current task ?
*
* @return boolean
**/
function canCreateItem()
{
if (!parent::canReadITILItem()) {
return false;
}
$ticket = new Ticket();
if ($ticket->getFromDB($this->fields['tickets_id'])) {
return Session::haveRight(self::$rightname, self::ADDALLTICKET) || $ticket->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(CommonITILActor::ASSIGN, $_SESSION['glpigroups']);
}
return false;
}
示例4: canUpdateItem
/**
* Is the current user have right to update the current followup ?
*
* @return boolean
**/
function canUpdateItem()
{
if ($this->fields["users_id"] != getLoginUserID() && !haveRight('update_followups', 1)) {
return false;
}
$ticket = new Ticket();
if (!$ticket->can($this->getField('tickets_id'), 'r')) {
return false;
}
if ($this->fields["users_id"] === getLoginUserID() && haveRight('update_own_followups', 1)) {
return true;
}
// Only the technician
return haveRight("update_followups", "1") || $ticket->isUser(Ticket::ASSIGN, getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(Ticket::ASSIGN, $_SESSION['glpigroups']);
}
示例5: checkApprobationSolution
/**
* check right for Approve ticket Solution
* for an authenticated user and a particular user
*
* @param $users_id user id used for check ticket right
* @param $ticket ticket object
*
* @return array of hashtable
**/
static function checkApprobationSolution($users_id, Ticket $ticket)
{
if (!self::checkUserRights(Session::getLoginUserID(), 'update_ticket', 1, $ticket->getField('entities_id'))) {
return false;
}
if (!($ticket->fields["users_id_recipient"] === $users_id || $ticket->isUser(CommonITILActor::REQUESTER, $users_id) || sizeof(Group_User::getUserGroups($users_id) > 0) && $ticket->haveAGroup(CommonITILActor::REQUESTER, Group_User::getUserGroups($users_id)))) {
return false;
}
return true;
}
示例6: canCreateItem
/**
* Is the current user have right to create the current task ?
*
* @return boolean
**/
function canCreateItem()
{
$ticket = new Ticket();
if (!$ticket->can($this->getField('tickets_id'), 'r')) {
return false;
}
return haveRight("global_add_tasks", "1") || $ticket->isUser(Ticket::ASSIGN, getLoginUserID()) || isset($_SESSION["glpigroups"]) && $ticket->haveAGroup(Ticket::ASSIGN, $_SESSION['glpigroups']);
}
示例7: checkApprobationSolution
/**
* check right for Approve ticket Solution
* for an authenticated user and a particular user
*
* @param $users_id user id used for check ticket right
* @param $ticket ticket object
*
* @return array of hashtable
**/
static function checkApprobationSolution($users_id, Ticket $ticket)
{
if (!($ticket->fields["users_id_recipient"] === $users_id || $ticket->isUser(CommonITILActor::REQUESTER, $users_id) || sizeof(Group_User::getUserGroups($users_id) > 0) && $ticket->haveAGroup(CommonITILActor::REQUESTER, Group_User::getUserGroups($users_id)))) {
return false;
}
return true;
}