16 include_once (
"Class.DbObj.php");
44 create table docpermext (
45 docid int check (docid > 0),
46 userid int check (userid > 1),
49 create unique index idx_permext on docpermext(docid, userid,acl);";
53 if ($this->userid == 1)
return _(
"not perm for admin");
74 $sql = sprintf(
"select * from docpermext where docid=%d and acl='%s' and userid in (%s)", $profid, pg_escape_string(
$acl) , implode(
',', $gids));
77 return (count($result) > 0);
81 static $grants = null;
82 if ($grants === null && $grants[
$docid] === null) {
83 simpleQuery(
'', sprintf(
"select * from docpermext where docid=%d",
$docid) , $qgrants);
84 $grants[
$docid] = $qgrants;
86 foreach ($grants[
$docid] as $aGrant) {
87 if ($aGrant[
"acl"] == $aclName && $aGrant[
"userid"] == $accountId)
return 'green';
91 foreach ($grants[
$docid] as $aGrant) {
92 if ($aGrant[
"acl"] == $aclName && in_array($aGrant[
"userid"], $mof))
return 'grey';
99 $sql = sprintf(
"SELECT docid, userid, acl FROM docpermext WHERE docid = %d ORDER BY docid, userid, acl",
$docid);
static isGranted($userid, $acl, $profid, $strict=false)
static getUserMemberOf($uid, $strict=false)
static getPermsForDoc($docid)
static hasExtAclGrant($docid, $accountId, $aclName)
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)