Skip to content

Commit

Permalink
Merge pull request #2070 from nextcloud/fix/access-enum
Browse files Browse the repository at this point in the history
fix(Form): If `permitAllUsers` is not set then no public access is granted
  • Loading branch information
Chartman123 authored Apr 15, 2024
2 parents ee3fc3a + 639ace9 commit 56c7e8f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Db/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ public function setAccess(array $access) {
// No further permissions -> 0
// Permit all users, but don't show in navigation -> 1
// Permit all users and show in navigation -> 2
if (!$access['permitAllUsers'] && !$access['showToAllUsers']) {
if (!$access['permitAllUsers']) {
// no permit means no public share
$value = Constants::FORM_ACCESS_NOPUBLICSHARE;
} elseif ($access['permitAllUsers'] && !$access['showToAllUsers']) {
$value = Constants::FORM_ACCESS_PERMITALLUSERS;
} else {
} elseif ($access['showToAllUsers']) {
// permit all + show to all
$value = Constants::FORM_ACCESS_SHOWTOALLUSERS;
} else {
// only permit all but not shown to all
$value = Constants::FORM_ACCESS_PERMITALLUSERS;
}

// If legacyLink add 3
Expand Down

0 comments on commit 56c7e8f

Please sign in to comment.