Skip to content
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 @@ -8,6 +8,9 @@ import {
import { removeNotificationWizardForm } from "../../../../slices/notificationSlice";
import { useAppDispatch, useAppSelector } from "../../../../store";
import { ParseKeys } from "i18next";
import {
getOrgProperties,
} from "../../../../selectors/userInfoSelectors";

/**
* This component manages the access policy tab of the series details modal
Expand All @@ -28,6 +31,9 @@ const SeriesDetailsAccessTab = ({
const policies = useAppSelector(state => getSeriesDetailsAcl(state));
const policyTemplateId = useAppSelector(state => getPolicyTemplateId(state));

const orgProperties = useAppSelector(state => getOrgProperties(state));
const overrideEnabled = (orgProperties["admin.series.acl.event.update.mode"] || "optional").toLowerCase() === "optional";

useEffect(() => {
dispatch(removeNotificationWizardForm());
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand All @@ -54,7 +60,7 @@ const SeriesDetailsAccessTab = ({
viewNonUsersAccessRole={"ROLE_UI_SERIES_DETAILS_ACL_NONUSER_ROLES_VIEW"}
policyChanged={policyChanged}
setPolicyChanged={setPolicyChanged}
withOverrideButton={true}
withOverrideButton={overrideEnabled}
/>
);
};
Expand Down
6 changes: 5 additions & 1 deletion src/components/shared/SaveEditFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type SaveEditFooterProps = {
reset: () => void;
submit: () => void;
isValid?: boolean;
customSaveButtonText?: ParseKeys;
additionalButton?: {
label: ParseKeys,
hint: ParseKeys,
Expand All @@ -20,10 +21,13 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
reset,
submit,
isValid,
customSaveButtonText,
additionalButton,
}) => {
const { t } = useTranslation();

const saveButtonText = customSaveButtonText || "SAVE";

return <footer style={{ padding: "0 15px" }}>
{active && isValid && (
<div className="pull-left">
Expand Down Expand Up @@ -56,7 +60,7 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
className={`save green ${
!isValid || !active ? "disabled" : ""
}`}
>{t("SAVE")}</BaseButton>
>{t(saveButtonText)}</BaseButton>
</div>
</footer>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ const ResourceDetailsAccessPolicyTab = ({
hint: "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.REPLACE_EVENT_ACLS_HINT",
onClick: () => saveAccess(formik.values, true),
} : undefined}
customSaveButtonText={withOverrideButton ? "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.SAVE_SERIES_ACL_ONLY" : undefined}
/>}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1225,12 +1225,14 @@
"ADDITIONAL_ACTIONS": "Additional Actions",
"ACTION": "Actions",
"NEW": "New policy",
"DETAILS": "Details",
"REPLACE_EVENT_ACLS": "Save series and overwrite event permissions",
"REPLACE_EVENT_ACLS_HINT": "Save the series permissions and overwrite the permissions for all events in this series.",
"SAVE_SERIES_ACL_ONLY": "Save series permission",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is adding new keys allowed in release branches (docs say "modify existing translation keys").

@ferishili ferishili Jan 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not yet final!
I only rebased to 18.x and fixed the conflicts!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this, I would guess this would be the answer: #1295 (comment)

However, I would ask your feedback on this, @Arnei

"NON_USER_ROLES": "Roles and Groups authorized for the series",
"USER": "User",
"USERS": "Users who are authorized for the series",
"NEW_USER": "New user",
"REPLACE_EVENT_ACLS": "Update series permissions",
"REPLACE_EVENT_ACLS_HINT": "Ensure all events of this series have these permissions in effect",
"LOAD_MORE_LIMIT": "policies shown.",
"LOAD_MORE_LINK": "Load more"
},
Expand Down
14 changes: 12 additions & 2 deletions src/slices/seriesDetailsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
getSeriesDetailsExtendedMetadata,
getStatistics,
} from "../selectors/seriesDetailsSelectors";
import {
getOrgProperties,
} from "../selectors/userInfoSelectors";
import { addNotification } from "./notificationSlice";
import {
transformMetadataCollection,
Expand Down Expand Up @@ -258,12 +261,19 @@ export const updateSeriesAccess = createAppAsyncThunk("seriesDetails/updateSerie
id: Series["id"],
policies: { acl: Acl },
override?: boolean
}, { dispatch }) => {
}, { dispatch, getState }) => {
const { id, policies, override } = params;

const data = new URLSearchParams();

const overrideString = override ? String(true) : String(false);
// Here we should check for the "always" option as well, so that we can force override!
const orgProperties = getOrgProperties(getState());
const alwaysOverride = (orgProperties["admin.series.acl.event.update.mode"] || "optional").toLowerCase() === "always";

let overrideString = override ? String(true) : String(false);
if (alwaysOverride) {
overrideString = String(true);
}

data.append("acl", JSON.stringify(policies));
data.append("override", overrideString);
Expand Down