/**
  * 
  */
 public function setACLWorldAccess($pn_world_access)
 {
     if (!($vn_id = (int) $this->getPrimaryKey())) {
         return null;
     }
     require_once __CA_MODELS_DIR__ . '/ca_acl.php';
     $vn_table_num = $this->tableNum();
     $t_acl = new ca_acl();
     $t_acl->load(array('group_id' => null, 'user_id' => null, 'table_num' => $vn_table_num, 'row_id' => $vn_id));
     // try to load existing record
     $t_acl->setMode(ACCESS_WRITE);
     $t_acl->set('table_num', $vn_table_num);
     $t_acl->set('row_id', $vn_id);
     $t_acl->set('user_id', null);
     $t_acl->set('group_id', null);
     $t_acl->set('access', $pn_world_access);
     if ($t_acl->getPrimaryKey()) {
         $t_acl->update();
     } else {
         $t_acl->insert();
     }
     if ($t_acl->numErrors()) {
         $this->errors = $t_acl->errors;
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$vs_id_prefix = $this->getVar('id_prefix');
$t_instance = $this->getVar('t_instance');
$t_item = $this->getVar('t_user');
// user
$t_subject = $this->getVar('t_subject');
$va_settings = $this->getVar('settings');
$vs_add_label = $this->getVar('add_label');
$t_acl = new ca_acl();
$vb_read_only = isset($va_settings['readonly']) && $va_settings['readonly'] || $this->request->user->getBundleAccessLevel($t_instance->tableName(), 'ca_users') == __CA_BUNDLE_ACCESS_READONLY__;
$t_acl->set('access', (int) $this->getVar('initialValue'));
?>
<div id="<?php 
print $vs_id_prefix . '_world';
?>
">
	<div class="bundleContainer">
		<div class="caItemList">
			<div id="<?php 
print $vs_id_prefix;
?>
_World" class="labelInfo">
				<table class="caListItem">
					<tr>
						<td class="formLabel">
							<?php