本文整理匯總了PHP中TBGSettings::isPermissive方法的典型用法代碼示例。如果您正苦於以下問題:PHP TBGSettings::isPermissive方法的具體用法?PHP TBGSettings::isPermissive怎麽用?PHP TBGSettings::isPermissive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::isPermissive方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __
disabled<?php
}
?>
>
<option value=1<?php
if (TBGSettings::isPermissive()) {
?>
selected<?php
}
?>
><?php
echo __('Permissive');
?>
</option>
<option value=0<?php
if (!TBGSettings::isPermissive()) {
?>
selected<?php
}
?>
><?php
echo __('Restrictive');
?>
</option>
</select>
</td>
</tr>
<tr>
<td class="config_explanation" colspan="2">
<?php
echo __("%restrictive: With this security policy, users don't automatically get access to projects, modules, etc., but must be granted access specifically.", array('%restrictive' => '<b>' . __('Restrictive') . '</b>'));
示例2: canCreatePublicSearches
/**
* Return if the user can create public saved searches
*
* @return boolean
*/
public function canCreatePublicSearches()
{
return $this->_dualPermissionsCheck('cancreatepublicsearches', 0, 'canfindissuesandsavesearches', 0, TBGSettings::isPermissive());
}
示例3: canUserDeleteOwnComment
/**
* Return if the user can delete own comment
*
* @return boolean
*/
public function canUserDeleteOwnComment()
{
$retval = $this->_canPermissionOrSeeAndEditComments('candeletecommentsown');
return $retval !== null ? $retval : TBGSettings::isPermissive();
}
示例4: canUserSet
public function canUserSet(TBGUser $user)
{
$retval = $user->hasPermission($this->getPermissionsKey(), $this->getID(), 'core', true);
$retval = $retval === null ? $user->hasPermission($this->getPermissionsKey(), 0, 'core', true) : $retval;
return $retval !== null ? $retval : TBGSettings::isPermissive();
}
示例5: checkPermission
/**
* Check to see if a specified user/group/team has access
*
* @param string $permission_type The permission type
* @param integer $uid The user id for which the permission is valid, 0 for all
* @param integer $gid The group id for which the permission is valid, 0 for all
* @param integer $tid The team id for which the permission is valid, 0 for all
* @param integer $target_id[optional] The target id
* @param string $module_name[optional] The name of the module for which the permission is valid
* @param boolean $explicit[optional] whether to check for an explicit permission and return false if not set
* @param boolean $permissive[optional] whether to return false or true when explicit fails
*
* @return unknown_type
*/
public static function checkPermission($permission_type, $uid, $gid, $tid, $target_id = 0, $module_name = 'core', $explicit = false, $permissive = false)
{
$uid = (int) $uid;
$gid = (int) $gid;
if (array_key_exists($module_name, self::$_permissions) && array_key_exists($permission_type, self::$_permissions[$module_name]) && (array_key_exists($target_id, self::$_permissions[$module_name][$permission_type]) || $target_id === null)) {
if (array_key_exists(0, self::$_permissions[$module_name][$permission_type])) {
$permissions_notarget = self::$_permissions[$module_name][$permission_type][0];
}
$permissions_target = array_key_exists($target_id, self::$_permissions[$module_name][$permission_type]) ? self::$_permissions[$module_name][$permission_type][$target_id] : array();
$retval = self::_permissionsCheck($permissions_target, $uid, $gid, $tid);
if (array_key_exists(0, self::$_permissions[$module_name][$permission_type])) {
$retval = $retval !== null ? $retval : self::_permissionsCheck($permissions_notarget, $uid, $gid, $tid);
}
if ($retval !== null) {
return $retval;
}
}
if ($explicit) {
return $permissive;
}
return TBGSettings::isPermissive();
}
示例6: canReportIssues
/**
* Return if the user can report new issues
*
* @param integer $product_id[optional] A product id
* @return boolean
*/
public function canReportIssues($project_id = null)
{
$retval = null;
if ($project_id !== null) {
if (is_numeric($project_id)) {
$project_id = TBGContext::factory()->TBGProject($project_id);
}
$project_id = $project_id instanceof TBGProject ? $project_id->getID() : $project_id;
$retval = $this->hasPermission('cancreateissues', $project_id, 'core', true, null);
$retval = $retval !== null ? $retval : $this->hasPermission('cancreateandeditissues', $project_id, 'core', true, null);
}
$retval = $retval !== null ? $retval : $this->hasPermission('cancreateissues', 0, 'core', true, null);
$retval = $retval !== null ? $retval : $this->hasPermission('cancreateandeditissues', 0, 'core', true, null);
return $retval !== null ? $retval : TBGSettings::isPermissive();
}
示例7: image_tag
if (is_bool($val)) {
?>
<?php
$image_tag = $val ? image_tag('permission_set_ok.png') : image_tag('permission_set_denied.png');
?>
<?php
} elseif ($mode == 'datatype') {
?>
<?php
$image_tag = image_tag('permission_set_unset.png');
?>
<?php
} elseif ($mode == 'general' && $type == 'everyone') {
?>
<?php
$image_tag = TBGSettings::isPermissive() ? image_tag('permission_unset_ok.png') : image_tag('permission_unset_denied.png');
?>
<?php
} elseif ($mode == 'configuration' && $type == 'everyone') {
?>
<?php
$image_tag = image_tag('permission_unset_denied.png');
?>
<?php
} elseif ($mode == 'pages' && $type == 'everyone') {
?>
<?php
$image_tag = image_tag('permission_unset_ok.png');
?>
<?php
} elseif ($mode == 'user' && $type == 'everyone') {
示例8: _canPermissionsOrExtraInformation
protected function _canPermissionsOrExtraInformation($permission)
{
if (isset($this->_can_permission_cache[$permission])) {
return $this->_can_permission_cache[$permission];
}
$retval = $this->_permissionCheck($permission);
$retval = $retval === null ? $this->canAddExtraInformation() : $retval;
$this->_can_permission_cache[$permission] = $retval;
return $retval !== null ? $retval : TBGSettings::isPermissive();
}
示例9: _dualPermissionsCheck
protected function _dualPermissionsCheck($permission_1, $permission_2, $fallback = null)
{
$retval = $this->permissionCheck($permission_1);
$retval = $retval === null ? $this->permissionCheck($permission_2) : $retval;
if ($retval !== null) {
return $retval;
} else {
return $fallback !== null ? $fallback : TBGSettings::isPermissive();
}
}