示例#1
0
 /**
  * Return if the user can create public saved searches
  *
  * @return boolean
  */
 public function canCreatePublicSearches()
 {
     return $this->_dualPermissionsCheck('cancreatepublicsearches', 0, 'canfindissuesandsavesearches', 0, framework\Settings::isPermissive());
 }
示例#2
0
 public function canUserSet(\thebuggenie\core\entities\User $user)
 {
     $retval = $user->hasPermission($this->getPermissionsKey(), $this->getID(), 'core');
     $retval = $retval === null ? $user->hasPermission($this->getPermissionsKey(), 0, 'core') : $retval;
     return $retval !== null ? $retval : \thebuggenie\core\framework\Settings::isPermissive();
 }
示例#3
0
 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 : framework\Settings::isPermissive();
     }
 }
 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_unset_ok.png');
     ?>
         <?php 
 } elseif ($mode == 'general' && $type == 'everyone') {
     ?>
             <?php 
     $image_tag = \thebuggenie\core\framework\Settings::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') {
示例#5
0
 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 : \thebuggenie\core\framework\Settings::isPermissive();
 }
示例#6
0
 /**
  * Return if the user can delete own comment
  *
  * @return boolean
  */
 public function canUserDeleteOwnComment()
 {
     $retval = $this->_canPermissionOrSeeAndEditComments('candeletecommentsown');
     return $retval !== null ? $retval : framework\Settings::isPermissive();
 }
示例#7
0
 disabled<?php 
}
?>
>
                <option value=1<?php 
if (\thebuggenie\core\framework\Settings::isPermissive()) {
    ?>
 selected<?php 
}
?>
><?php 
echo __('Permissive');
?>
</option>
                <option value=0<?php 
if (!\thebuggenie\core\framework\Settings::isPermissive()) {
    ?>
 selected<?php 
}
?>
><?php 
echo __('Restrictive');
?>
</option>
            </select>

            <?php 
echo config_explanation(__("%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>')) . "<br>" . __("%permissive: This security policy assume you have access to things like projects, pages, etc.", array('%permissive' => '<b>' . __('Permissive') . '</b>')) . "<br><br>" . __("If you're running a public tracker, or a tracker with several projects you probably want to use a restrictive security policy - however, with smaller teams or and simpler projects, permissive security policy will be most efficient.") . "<br><br><i>" . __("Some permissions, such as configuration access are not affected by this setting, but must always be explicitly defined") . "</i>");
?>
        </td>
    </tr>