new acl-right: READ_Calender.

This is made, cause there might be installations, where useres are not permittet to see how much a resource in used
etc...
This commit is contained in:
Cornelius Weiß 2005-06-11 08:10:22 +00:00
parent ec6a4600e8
commit 85829662ba
3 changed files with 22 additions and 15 deletions

View File

@ -34,7 +34,7 @@
{
define('EGW_ACL_CAT_ADMIN',64);
define('EGW_ACL_DIRECT_BOOKING',128);
// define('EGW_ACL_CUSTOM_3',256);
define('EGW_ACL_CALREAD',256);
$this->so =& CreateObject('resources.so_acl');
$this->permissions = $this->so->get_permissions($GLOBALS['egw_info']['user']['account_id'],true);
@ -183,11 +183,12 @@
$this->limit = $data['limit'];
}
function set_rights($cat_id,$read,$write,$book,$admin)
function set_rights($cat_id,$read,$write,$calread,$calbook,$admin)
{
$readcat = $read ? $read : array();
$writecat = $write ? $write : array();
$bookcat = $book ? $book : array();
$calreadcat = $calread ? $calread : array();
$calbookcat = $calbook ? $calbook : array();
$admincat = $admin ? $admin : array();
$this->so->remove_location('L' . $cat_id);
@ -199,7 +200,8 @@
$rights = in_array($account_id,$writecat) ?
(EGW_ACL_READ | EGW_ACL_ADD | EGW_ACL_EDIT | EGW_ACL_DELETE) :
(in_array($account_id,$readcat) ? EGW_ACL_READ : False);
$rights = in_array($account_id,$bookcat) ? ($rights | EGW_ACL_DIRECT_BOOKING) : $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,$admincat) ? ($rights | EGW_ACL_CAT_ADMIN) : $rights;
if ($rights)
{

View File

@ -57,7 +57,8 @@
{
foreach($_POST['catids'] as $cat_id)
{
$this->bo->set_rights($cat_id,$_POST['inputread'][$cat_id],$_POST['inputwrite'][$cat_id],$_POST['inputbook'][$cat_id],$_POST['inputadmin'][$cat_id]);
$this->bo->set_rights($cat_id,$_POST['inputread'][$cat_id],$_POST['inputwrite'][$cat_id],
$_POST['inputcalread'][$cat_id],$_POST['inputcalbook'][$cat_id],$_POST['inputadmin'][$cat_id]);
}
}
@ -71,7 +72,8 @@
'lang_read' => lang('Read permissions'),
'lang_write' => lang('Write permissions'),
'lang_implies' => lang('implies read permission'),
'lang_book' => lang('Direct booking permissions'),
'lang_calread' => lang('Read Calender permissions'),
'lang_calbook' => lang('Direct booking permissions'),
'lang_cat_admin' => lang('Categories admin')
));
@ -101,7 +103,8 @@
'catid' => $cat['id'],
'read' => $this->selectlist(EGW_ACL_READ),
'write' => $this->selectlist(EGW_ACL_ADD),
'book' =>$this->selectlist(EGW_ACL_DIRECT_BOOKING),
'calread' => $this->selectlist(EGW_ACL_CALREAD),
'calbook' =>$this->selectlist(EGW_ACL_DIRECT_BOOKING),
'admin' => '<option value="" selected="1">'.lang('choose categories admin').'</option>'.$this->selectlist(EGW_ACL_CAT_ADMIN,true)
));
$GLOBALS['egw']->template->parse('Cblock','cat_list',True);

View File

@ -1,10 +1,10 @@
<center>
<table border="0" cellspacing="2" cellpadding="2" width="80%">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr>
<td colspan="3" align="center" bgcolor="#c9c9c9"><b>{title}<b/></td>
<td colspan="5" align="center" bgcolor="#c9c9c9"><b>{title}<b/></td>
</tr>
<tr>
<td colspan="3" align="left">
<td colspan="5" align="left">
<table border="0" width="100%">
<tr>
{left}
@ -16,18 +16,19 @@
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3" align="right">
<td colspan="5" align="right">
<form method="POST"><input type="text" name="query" value="{query}" />&nbsp;<input type="submit" name="btnSearch" value="{lang_search}" /></form>
</td>
</tr>
</table>
<form method="POST">
<table border="0" cellspacing="2" cellpadding="2" width="80%">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr bgcolor="{th_bg}" valign="middle" align="center">
<td>{sort_cat}<br>{lang_cat_admin}</td>
<td>{lang_read}</td>
<td>{lang_write}<br>({lang_implies})</td>
<td>{lang_book}</td>
<td>{lang_calread}</td>
<td>{lang_calbook}</td>
</tr>
<!-- BEGIN cat_list -->
<tr bgcolor="{tr_color}">
@ -37,11 +38,12 @@
</td>
<td align="center"><select multiple="multiple" size="5" name="inputread[{catid}][]">{read}</select></td>
<td align="center"><select multiple="multiple" size="5" name="inputwrite[{catid}][]">{write}</select></td>
<td align="center"><select multiple="multiple" size="5" name="inputbook[{catid}][]">{book}</select></td>
<td align="center"><select multiple="multiple" size="5" name="inputcalread[{catid}][]">{calread}</select></td>
<td align="center"><select multiple="multiple" size="5" name="inputcalbook[{catid}][]">{calbook}</select></td>
</tr>
<!-- END cat_list -->
<tr>
<td colspan="4" align="left">
<td colspan="5" align="left">
<br>
<input type="submit" name="btnSave" value="{lang_save}"> &nbsp;
<input type="submit" name="btnDone" value="{lang_done}">