20 include_once (
"FDL/Class.Doc.php");
27 $usage->setDefinitionText(
"modify document acl");
28 $userid =
$usage->addRequiredParameter(
"userid",
"user identificator");
29 $aclp =
$usage->addOptionalParameter(
"aclup",
"acls to add",
function ($argVal, $argName, $apiUsage)
33 $docid =
$usage->addRequiredParameter(
"docid",
"profil identificator");
45 $doc->removeControl($userid);
46 if (is_array($aclp)) {
47 foreach ($aclp as $k => $aclName) {
48 $doc->addControl($userid, $aclName);
52 $doc->setViewProfil();
54 $doc->recomputeProfiledDocument();
55 if (is_array($aclp) && (count($aclp) > 0)) {
57 foreach (
$doc->dacls as $aclK => $aclInfo) {
58 if (in_array($aclInfo[
"pos"], $aclp)) {
59 $aclName[] = _($aclK);
63 $doc->addHistoryEntry(sprintf(_(
"Change control for %s user. Set %s privileges") ,
Account::getDisplayName($userid) , implode(
', ', $aclName)));
67 redirect($action,
"FREEDOM", sprintf(
"FREEDOM_ACCESS&userid=%d&id=%d", $userid,
$docid));
exitError($texterr, $exit=true, $code="")
static getDisplayName($uid)
Verify arguments for action function.
new_Doc($dbaccess, $id= '', $latest=false)
if($file) if($subject==""&&$file) if($subject=="") $err
static isArray($argVal, $argName, $apiUsage)