16 include_once (
"Class.DbObj.php");
44 create table docperm (
45 docid int check (docid > 0),
46 userid int check (userid > 1),
49 create unique index idx_perm on docperm(docid, userid);";
53 if (count(
$tid) == 2) {
55 $this->userid =
$tid[1];
61 if ($this->userid == 1)
return _(
"not perm for admin");
81 if (
$strict) $mof = $action->user->getStrictMemberOf();
82 else $mof = $action->user->getMemberOf();
83 $mof[] = $action->user->id;
89 return '{' . implode(
',', $mof) .
'}';
102 $sql = sprintf(
"select getaperm('%s',%d) as uperm", $userMember, $profid);
104 if (
$uperm ===
false)
return 0;
113 $sql = sprintf(
"select getaperm('%s',%d) as uperm", $userMember, $profid);
115 if (
$uperm ===
false)
return 0;
126 if ($this->uperm == 0) {
161 return (($acl & (1 << ($pos))) != 0);
177 $this->upacl = intval($this->upacl) | (1 << $pos);
187 $this->upacl = $this->upacl & (~(1 << $pos));
192 $sql = sprintf(
"SELECT docid, userid, upacl FROM docperm WHERE docid = %d ORDER BY docid, userid, upacl",
$docid);
static getMemberOfVector($uid=0, $strict=false)
static getUserMemberOf($uid, $strict=false)
static getPermsForDoc($docid)
static getUperm($profid, $userid, $strict=false)
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
static getStrictUperm($profid, $userid)