{if $action != 'edit' || $page->pageType != 'system'}
<div id="acl" class="tabMenuContent">
- {include file='aclSimple'}
+ {include file='aclSimple' __supportsInvertedPermissions=true}
</div>
{/if}
->columns([
DefaultFalseBooleanDatabaseTableColumn::create('invertPermissions'),
]),
+
+ PartialDatabaseTable::create('wcf1_page')
+ ->columns([
+ DefaultFalseBooleanDatabaseTableColumn::create('invertPermissions'),
+ ]),
];
(new DatabaseTableChangeProcessor(
*/
public $presetPage;
+ /**
+ * @var bool
+ * @since 5.4
+ */
+ public $invertPermissions;
+
/**
* @inheritDoc
*/
if (isset($_POST['aclValues']) && \is_array($_POST['aclValues'])) {
$this->aclValues = $_POST['aclValues'];
}
+ if (isset($_POST['invertPermissions'])) {
+ $this->invertPermissions = $_POST['invertPermissions'];
+ }
}
/**
'isMultilingual' => $this->isMultilingual,
'identifier' => '',
'packageID' => 1,
+ 'invertPermissions' => $this->invertPermissions,
]),
'content' => $content,
'boxToPage' => $this->getBoxToPage(),
'com.woltlab.wcf.page',
$this->presetPage->pageID
);
+ $this->invertPermissions = $this->presetPage->invertPermissions;
}
}
'parentMenuItemID' => $this->parentMenuItemID,
'menuItemNodeList' => $this->menuItems->getNodeList(),
'enableShareButtons' => $this->enableShareButtons,
+ 'invertPermissions' => $this->invertPermissions,
]);
}
}
'availableDuringOfflineMode' => $this->availableDuringOfflineMode,
'allowSpidersToIndex' => $this->allowSpidersToIndex,
'enableShareButtons' => $this->enableShareButtons,
+ 'invertPermissions' => $this->invertPermissions,
];
if ($this->pageType == 'system') {
}
$this->aclValues = SimpleAclHandler::getInstance()->getValues('com.woltlab.wcf.page', $this->page->pageID);
+ $this->invertPermissions = $this->page->invertPermissions;
}
}
* @property-read string $enableShareButtons is `1` if the page should display share buttons, otherwise `0`
* @property-read string $permissions comma separated list of user group permissions of which the active user needs to have at least one to access the page
* @property-read string $options comma separated list of options of which at least one needs to be enabled for the page to be accessible
+ * @property-read bool $invertPermissions is `1` if the permissions are inverted
*/
class Page extends DatabaseObject implements ILinkableObject, ITitledObject
{
*/
public function isAccessible()
{
- return SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.page', $this->pageID);
+ $canAccess = SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.page', $this->pageID);
+
+ if ($this->invertPermissions) {
+ $canAccess = !$canAccess;
+ }
+
+ return $canAccess;
}
/**
excludeFromLandingPage TINYINT(1) NOT NULL DEFAULT 0,
enableShareButtons TINYINT(1) NOT NULL DEFAULT 0,
permissions TEXT NULL,
- options TEXT NULL
+ options TEXT NULL,
+ invertPermissions TINYINT(1) NOT NULL DEFAULT 0
);
DROP TABLE IF EXISTS wcf1_page_box_order;