fixed rights admin

This commit is contained in:
Cornelius Weiß 2005-06-12 08:20:44 +00:00
parent 3ccbf08a09
commit dcf2a196d4
3 changed files with 13 additions and 11 deletions

View File

@ -192,17 +192,18 @@
$admincat = $admin ? $admin : array(); $admincat = $admin ? $admin : array();
$this->so->remove_location('L' . $cat_id); $this->so->remove_location('L' . $cat_id);
reset($this->accounts); // reset($this->accounts);
while (list($null,$account) = each($this->accounts)) // while (list($null,$account) = each($this->accounts))
foreach($this->accounts as $num => $account)
{ {
$account_id = $account['account_id']; $account_id = $account['account_id'];
//write implies read $rights = false;
$rights = in_array($account_id,$writecat) ? $rights = in_array($account_id,$readcat) ? ($rights | EGW_ACL_READ) : false;
(EGW_ACL_READ | EGW_ACL_ADD | EGW_ACL_EDIT | EGW_ACL_DELETE) : $rights = in_array($account_id,$writecat) ? ($rights | EGW_ACL_READ | EGW_ACL_ADD | EGW_ACL_EDIT | EGW_ACL_DELETE): $rights;
(in_array($account_id,$readcat) ? EGW_ACL_READ : False);
$rights = in_array($account_id,$calreadcat) ? ($rights | EGW_ACL_CALREAD) : $rights; $rights = in_array($account_id,$calreadcat) ? ($rights | EGW_ACL_CALREAD) : $rights;
$rights = in_array($account_id,$calbookcat) ? ($rights | EGW_ACL_DIRECT_BOOKING) : $rights; $rights = in_array($account_id,$calbookcat) ? ($rights | EGW_ACL_DIRECT_BOOKING | EGW_ACL_CALREAD) : $rights;
$rights = in_array($account_id,$admincat) ? ($rights | EGW_ACL_CAT_ADMIN) : $rights; $rights = in_array($account_id,$admincat) ? ($rights = 511) : $rights;
if ($rights) if ($rights)
{ {
$GLOBALS['egw']->acl->add_repository('resources','L'.$cat_id,$account_id,$rights); $GLOBALS['egw']->acl->add_repository('resources','L'.$cat_id,$account_id,$rights);

View File

@ -71,9 +71,10 @@
'lang_done' => lang('Done'), 'lang_done' => lang('Done'),
'lang_read' => lang('Read permissions'), 'lang_read' => lang('Read permissions'),
'lang_write' => lang('Write permissions'), 'lang_write' => lang('Write permissions'),
'lang_implies' => lang('implies read permission'), 'lang_implies_read' => lang('implies read permission'),
'lang_calread' => lang('Read Calender permissions'), 'lang_calread' => lang('Read Calender permissions'),
'lang_calbook' => lang('Direct booking permissions'), 'lang_calbook' => lang('Direct booking permissions'),
'lang_implies_book' => lang('implies booking permission'),
'lang_cat_admin' => lang('Categories admin') 'lang_cat_admin' => lang('Categories admin')
)); ));

View File

@ -26,9 +26,9 @@
<tr bgcolor="{th_bg}" valign="middle" align="center"> <tr bgcolor="{th_bg}" valign="middle" align="center">
<td>{sort_cat}<br>{lang_cat_admin}</td> <td>{sort_cat}<br>{lang_cat_admin}</td>
<td>{lang_read}</td> <td>{lang_read}</td>
<td>{lang_write}<br>({lang_implies})</td> <td>{lang_write}<br>({lang_implies_read})</td>
<td>{lang_calread}</td> <td>{lang_calread}</td>
<td>{lang_calbook}</td> <td>{lang_calbook}<br>({lang_implies_book})</td>
</tr> </tr>
<!-- BEGIN cat_list --> <!-- BEGIN cat_list -->
<tr bgcolor="{tr_color}"> <tr bgcolor="{tr_color}">