Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Spaces Management - Meeds-io/MIPs#160 #1209

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2078,11 +2078,11 @@ private boolean canImportNotes(String authenticatedUser, Space space, Page page)

private boolean canViewNotes(String authenticatedUser, Space space, Page page) throws WikiException {
if (space != null) {
return !page.isDraftPage() ? spaceService.isMember(space, authenticatedUser) : Utils.canManageNotes(authenticatedUser, space, page);
return !page.isDraftPage() ? spaceService.canViewSpace(space, authenticatedUser) : Utils.canManageNotes(authenticatedUser, space, page);
} else if (StringUtils.equals(page.getOwner(), IdentityConstants.SYSTEM) || StringUtils.isBlank(page.getOwner())) {
return cmsService.hasAccessPermission(Utils.getIdentity(authenticatedUser), NotePageViewService.CMS_CONTENT_TYPE, page.getName());
} else {
return spaceService.isSuperManager(authenticatedUser) || StringUtils.equals(page.getOwner(), authenticatedUser);
return spaceService.isSuperManager(space, authenticatedUser) || StringUtils.equals(page.getOwner(), authenticatedUser);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public void onStartRequest(final Application app, final WebuiRequestContext cont
}

// If user is not member of space but has view permission
if (space != null && !Space.HIDDEN.equals(space.getVisibility()) && !spaceService.isSuperManager(currentUser)
&& !spaceService.isMember(space, currentUser)) {
if (space != null && !Space.HIDDEN.equals(space.getVisibility()) && !spaceService.isSuperManager(space, currentUser)
&& !spaceService.canViewSpace(space, currentUser)) {
WikiPageParams wikiPageParams = new WikiPageParams(PortalConfig.GROUP_TYPE, owner, pageId);
String permalink = Utils.getPermanlink(wikiPageParams, false);
redirect(permalink);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
:labels="spaceSuggesterLabels"
:include-users="false"
:width="220"
:search-options="{
filterType: 'accessible',
}"
name="spacesSuggester"
class="user-suggester mt-n2"
include-spaces
Expand Down