determines if a globalID has access priviledges for a specific interface

@param $gid the GlobalID of the user accessing the interface
@param $interface name of the interface being accessed or wildcard (*)

@return boolean
432082
public function hasInterfaceAccessPriviledges($owner, $gid, $interface, $accessMethod = '*')
	{
		if($interface == '')
			$interface = '*';

		// TODO implement checks for distiction for R/W/*

		try
		{
			$rules = $this->loadAccessControlRulesForInterface($owner, $gid, $interface);

			// filter out rules with wrong access type
			if($accessMethod == AccessControlRuleObject::ACCESS_TYPE_WRITE)
			{
				foreach($rules as $id => $rule)
				{
					if($rule->getAccessType() == AccessControlRuleObject::ACCESS_TYPE_READ)
						unset($rules[$id]);
				}
			}
			elseif($accessMethod == AccessControlRuleObject::ACCESS_TYPE_READ)
			{
				foreach($rules as $id => $rule)
				{
					if($rule->getAccessType() == AccessControlRuleObject::ACCESS_TYPE_WRITE)
						unset($rules[$id]);
				}
			}

			return $this->executeAccessControlRules($gid, $rules);
		}
		catch (AccessControlManagerException $e)
		{
			if($this->baseDirectiveInterface == AccessControlManager::DIRECTIVE_DENY)
				return false;
			else
				return true;
		}
	}
954977
public function chown($uid, $gid = -1, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!$this->fd) {
            if ($cb) {
                $cb($this, false);
            }
            return false;
        }
        if (!FileSystem::$supported) {
            $r = chown($this->path, $uid);
            if ($gid !== -1) {
                $r = $r && chgrp($this->path, $gid);
            }
            if ($cb) {
                $cb($this, $r);
            }
            return false;
        }
        return eio_fchown($this->fd, $uid, $gid, $pri, $cb, $this);
    }
183825
public function hasUserForUuid($uuid)
    {
        if ($this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $uuid)) {
            return true;
        }
        
        return false;
    }
400161
public function check_tool_proxy($toolproxyguid, $body = null) {

        $ok = false;
        $toolproxy = null;
        $consumerkey = lti\get_oauth_key_from_headers();
        if (empty($toolproxyguid)) {
            $toolproxyguid = $consumerkey;
        }

        if (!empty($toolproxyguid)) {
            $toolproxy = lti_get_tool_proxy_from_guid($toolproxyguid);
            if ($toolproxy !== false) {
                if (!$this->is_unsigned() && ($toolproxy->guid == $consumerkey)) {
                    $ok = $this->check_signature($toolproxy->guid, $toolproxy->secret, $body);
                } else {
                    $ok = $this->is_unsigned();
                }
            }
        }
        if ($ok) {
            $this->toolproxy = $toolproxy;
        }
        return $ok;
    }
288916
public boolean isRegistry(BareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        Objects.requireNonNull(jid, "JID argument must not be null");
        // At some point 'usedRegistries' will also contain the registry returned by findRegistry(), but since this is
        // not the case from the beginning, we perform findRegistry().equals(jid) too.
        Jid registry = findRegistry();
        if (jid.equals(registry)) {
            return true;
        }
        if (usedRegistries.contains(jid)) {
            return true;
        }
        return false;
    }
1181090
public function sendDemoteParticipants($gId, $participant)
    {
        $msgId = $this->createMsgId();
        $this->sendGroupsChangeParticipants($gId, $participant, 'demote', $msgId);
    }
716255
public function access($permission, $user_id = null)
    {
        if ($this->isSuperadmin($user_id)) {
            return true;
        }

        if ($permission === GC_PERM_SUPERADMIN) {
            return false;
        }

        return in_array($permission, $this->getPermissions($user_id));
    }
773834
public static boolean isGsi2Proxy(GSIConstants.CertificateType certType) {
        return certType == GSIConstants.CertificateType.GSI_2_PROXY
                || certType == GSIConstants.CertificateType.GSI_2_LIMITED_PROXY;
    }
1066751
public function getAdminModalRemoveGroup($id = null, $gid = null)
    {
        $confirm_route = $error = null;

        $title = 'Remove group';
        $message = 'Are you sure to remove this group from this user?';

        // Get user information
        $user = Sentinel::findById($id);

        if ($user == null)
        {
            // Prepare the error message
            $error = Lang::get('base.auth.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Check if we are not trying to delete ourselves
        if ($user->id === Sentinel::getUser()->id + 1)  {
            // Prepare the error message
            $error = Lang::get('base.base.yourself');

            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Get group information
        $group = Sentinel::findRoleById($gid);

        if ($group == null)
        {
            // Prepare the error message
            $error = Lang::get('base.groups.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        $confirm_route = route('remove/group', ['id' => $user->id, 'gid' => $group->id]);
        return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
    }
144595
public function getObjectInstanceByGuid($guid)
    {
        if (isset($this->objectsByGuid[$guid])) {
            return $this->objectsByGuid[$guid];
        } else {
            return null;
        }
    }
680695
def chgid(name, gid):
    '''
    
    '''
    pre_gid = __salt__['file.group_to_gid'](name)
    if gid == pre_gid:
        return True
    cmd = 'groupmod -g {0} {1}'.format(gid, name)
    __salt__['cmd.run'](cmd, python_shell=False)
    post_gid = __salt__['file.group_to_gid'](name)
    if post_gid != pre_gid:
        return post_gid == gid
    return False
1152448
public function canDelete($user_guid = 0) {
		
		$user_guid = (int) $user_guid;
		if (empty($user_guid)) {
			$user_guid = elgg_get_logged_in_user_guid();
		}
		
		return elgg_is_admin_user($user_guid);
	}
228035
public function groupPosts($gid, $options = '') {
		if(!is_string($gid)){
			throw new LinkedInException('LinkedIn->groupPosts(): bad data passed, $gid must be of type string');
		}
		if(!is_string($options)){
			throw new LinkedInException('LinkedIn->groupPosts(): bad data passed, $options must be of type string');
		}
		
		// construct and send the request
		$query    = self::_URL_API . '/v1/groups/' . trim($gid)  .'/posts' . trim($options);
		$response = $this->fetch('GET', $query);
		
		/**
	   * Check for successful request (a 200 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */
		return $this->checkResponse(200, $response);
	}
179689
public function getGroupAuthList($gid, $type = 1)
    {
        // 转换表名
        $auth_group = $this->config['auth_group'];
        $auth_rule = $this->config['auth_rule'];
        // 执行查询
        $rules = Db::name($auth_group)->where(['status'=>1, 'id'=>$gid])->value('rules');
        // 格式化access表id
        $ids = explode(',', trim($rules, ','));
        $ids = array_unique($ids);
        $map = array(
            'id' => ['in', $ids],
            'type' => $type,
            'status' => 1,
        );
        //读取用户组所有权限规则
        $rules = Db::name($auth_rule)->where($map)->column('title,name,condition');

        return $rules;
    }
1112374
public function characteristicsReadGroupIndex($gid) {
    $query = $this->connection->select('site_commerce_characteristics_group_index', 'n');
    $query->fields('n');
    $query->condition('gid', $gid);

    return $query->execute()->fetchObject();
  }
165229
function getGuildID($guild) {
        if($guild === null || $guild === 'global') {
            return 'global';
        }
        
        return $this->client->guilds->resolve($guild)->id;
    }
449427
public static function getCommonGroups($uid, $pid)
	{
		// Get the groups the visiting user
		$xgroups = self::getGroups($uid, 'all', 1);

		$usersgroups = array();
		if (!empty($xgroups))
		{
			foreach ($xgroups as $group)
			{
				if ($group->regconfirmed)
				{
					$usersgroups[] = $group->cn;
				}
			}
		}

		// Get the groups of the profile
		$pgroups = self::getGroups($pid, 'all', 1);

		// Get the groups the user has access to
		$profilesgroups = array();
		if (!empty($pgroups))
		{
			foreach ($pgroups as $group)
			{
				if ($group->regconfirmed)
				{
					$profilesgroups[] = $group->cn;
				}
			}
		}

		// Find the common groups
		return array_intersect($usersgroups, $profilesgroups);
	}