Skip to content

Commit

Permalink
supereditors stop becoming authors close #361
Browse files Browse the repository at this point in the history
...each time they edit a page.
+ add info about privacy of pages in manual
  • Loading branch information
vincent-peugnet committed Nov 7, 2023
1 parent 1acd192 commit f1dd2fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
15 changes: 13 additions & 2 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,14 @@ Tags are very powerfull to help you organize your pages. As in __W__, there is n

Tags can be set in the [left panel of the editor interface](#left-panel) using comma to separate tags, or by using the multi edit tool in the [Home menu bar > Edit](#home-menu).

##### Privacy

Pages have 3 possible levels of privacy:

- **public** Free to read for every [visitor](#visitor).
- **private** Hidden to [visitor](#visitor), but accessible to [reader users](#reader).
- **not published** Only readable for users allowed to edit the page.

##### Date

This metadata can be set manually by the page editors.
Expand Down Expand Up @@ -1027,6 +1035,8 @@ Count the number of time the page is opened is opened.

> level : 1
Reader users are allowed to read [private pages](#privacy).

#### Invite Editor

> level : 2
Expand All @@ -1038,13 +1048,14 @@ Invite Editors are the lowest editor status possible. They can only access the [
> level : 3
- Can create pages and edit them.
- Can only edit pages when listed as [author](#authors)
- Can only edit pages when listed as [author](#authors).

#### Super Editor

> level : 4
- Can edit any pages they like (they will be added as [author](#authors) of the page).
- Can edit any pages they like.
- Can manage users as [author](#authors) of a page.
- Can use the home menu and media menu to access powerfull features.

#### Administrator
Expand Down
2 changes: 0 additions & 2 deletions app/class/Controllerapipage.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public function update(string $page)

if ($this->page->datemodif() == $oldpage->datemodif()) {
$this->page->updateedited();
$this->page->addauthor($this->user->id());
if ($this->pagemanager->update($this->page)) {
http_response_code(200);
header('Content-type: application/json; charset=utf-8');
Expand Down Expand Up @@ -137,7 +136,6 @@ public function put(string $page)
$this->shortresponse(401, 'Page already exist but user cannot update it');
}
$this->page = new Page(array_merge($this->recievejson(), ['id' => $page]));
$this->page->addauthor($this->user->id());
if ($this->pagemanager->update($this->page)) {
http_response_code($exist ? 200 : 201);
} else {
Expand Down
3 changes: 1 addition & 2 deletions app/class/Controllerpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function update($page)

if ($this->importpage()) {
if ($this->canedit()) {
// Check if someone esle edited the page during the editing.
// Check if someone else edited the page during the editing.
$oldpage = clone $this->page;
$this->page->hydrate($_POST);

Expand All @@ -465,7 +465,6 @@ public function update($page)
$this->routedirect('pageedit', ['page' => $this->page->id()]);
} else {
$this->page->updateedited();
$this->page->addauthor($this->user->id());
$this->page->removeeditby($this->user->id());

$this->pagemanager->update($this->page);
Expand Down

0 comments on commit f1dd2fc

Please sign in to comment.