+ Push to Underlay
+ >
+ }
+ >
Push this community’s releases and metadata to an Underlay collection. Only
new or changed content is transferred.
diff --git a/server/community/model.ts b/server/community/model.ts
index 89023b8133..c5bd06a7f0 100644
--- a/server/community/model.ts
+++ b/server/community/model.ts
@@ -256,6 +256,27 @@ export class Community extends Model<
@Column(DataType.TEXT)
declare kfOrgId: string | null;
+ /**
+ * CMS mode: the community is only visible to members;
+ * public visitors are shown a not-found page with a sign-in prompt.
+ */
+ @Default(false)
+ @AllowNull(false)
+ @Column(DataType.BOOLEAN)
+ declare cmsMode: CreationOptional;
+
+ /** External canonical home for this community's content, e.g. https://journal.example.org */
+ @Column(DataType.TEXT)
+ declare canonicalBaseUrl: string | null;
+
+ /**
+ * Template for canonical pub URLs on the external site, with {slug} as the
+ * pub slug, e.g. https://journal.example.org/articles/{slug}. When unset,
+ * canonicalBaseUrl + /pub/{slug} is used.
+ */
+ @Column(DataType.TEXT)
+ declare canonicalPubUrlTemplate: string | null;
+
@BelongsTo(() => CommunityTemplate, {
as: 'template',
foreignKey: 'templateId',
diff --git a/server/community/permissions.ts b/server/community/permissions.ts
index 133a1d38f5..a2973650bd 100644
--- a/server/community/permissions.ts
+++ b/server/community/permissions.ts
@@ -71,17 +71,19 @@ export const getPermissions = async ({
const canUpdate = scopeData.activePermissions.canManage;
const canAdmin = scopeData.activePermissions.canAdmin;
- const canExportCommunity =
- scopeData.activePermissions.canAdminCommunity || scopeData.activePermissions.isSuperAdmin;
+ const isSuperAdmin = scopeData.activePermissions.isSuperAdmin;
+ const canExportCommunity = scopeData.activePermissions.canAdminCommunity || isSuperAdmin;
- // only admins can edit analytics settings
- const editPropsWithAnalytics = canAdmin
- ? ([...editProps, 'analyticsSettings'] as const)
- : editProps;
+ // only admins can edit analytics settings and toggle CMS mode
+ const adminEditProps = canAdmin ? (['analyticsSettings', 'cmsMode'] as const) : ([] as const);
+ // only superadmins can point a community at an external canonical URL
+ const superAdminEditProps = isSuperAdmin
+ ? (['canonicalBaseUrl', 'canonicalPubUrlTemplate'] as const)
+ : ([] as const);
return {
create: true,
- update: canUpdate ? editPropsWithAnalytics : false,
+ update: canUpdate ? [...editProps, ...adminEditProps, ...superAdminEditProps] : false,
admin: canAdmin,
communityExport: canExportCommunity,
};
diff --git a/server/doi/queries.ts b/server/doi/queries.ts
index f935ed542b..ce276df3d0 100644
--- a/server/doi/queries.ts
+++ b/server/doi/queries.ts
@@ -60,7 +60,17 @@ export const findPub = (pubId) =>
const findCommunity = (communityId) =>
Community.findOne({
where: { id: communityId },
- attributes: ['id', 'title', 'issn', 'domain', 'subdomain', 'citeAs', 'publishAs'],
+ attributes: [
+ 'id',
+ 'title',
+ 'issn',
+ 'domain',
+ 'subdomain',
+ 'citeAs',
+ 'publishAs',
+ 'canonicalBaseUrl',
+ 'canonicalPubUrlTemplate',
+ ],
});
export const persistCrossrefDepositRecord = async (ids, depositJson) => {
diff --git a/server/errorPages/communityNotFound.html b/server/errorPages/communityNotFound.html
index f34a39e097..3b2ed5d52b 100644
--- a/server/errorPages/communityNotFound.html
+++ b/server/errorPages/communityNotFound.html
@@ -70,6 +70,21 @@
height: 150px;
opacity: 0.5;
}
+
+ .login-button {
+ display: inline-block;
+ margin-top: 16px;
+ padding: 8px 20px;
+ border-radius: 3px;
+ background-color: #408fec;
+ color: #ffffff;
+ font-size: 15px;
+ text-decoration: none;
+ }
+
+ .login-button:hover {
+ background-color: #2f7fdc;
+ }
@@ -92,9 +107,10 @@
We can't find that Community.
Check to make sure you've typed the URL correctly. If you're certain there should be
- a Community here, please make sure you're logged in first and then reload this page, or
+ a Community here, it may only be visible to its members. If the problem persists,
contact us.
+