File tree Expand file tree Collapse file tree
events/partials/ModalTabsAndPages
i18n/org/opencastproject/adminui/languages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import { removeNotificationWizardForm } from "../../../../slices/notificationSlice" ;
99import { useAppDispatch , useAppSelector } from "../../../../store" ;
1010import { ParseKeys } from "i18next" ;
11+ import {
12+ getOrgProperties ,
13+ } from "../../../../selectors/userInfoSelectors" ;
1114
1215/**
1316 * This component manages the access policy tab of the series details modal
@@ -28,6 +31,9 @@ const SeriesDetailsAccessTab = ({
2831 const policies = useAppSelector ( state => getSeriesDetailsAcl ( state ) ) ;
2932 const policyTemplateId = useAppSelector ( state => getPolicyTemplateId ( state ) ) ;
3033
34+ const orgProperties = useAppSelector ( state => getOrgProperties ( state ) ) ;
35+ const overrideEnabled = ( orgProperties [ "admin.series.acl.event.update.mode" ] || "optional" ) . toLowerCase ( ) === "optional" ;
36+
3137 useEffect ( ( ) => {
3238 dispatch ( removeNotificationWizardForm ( ) ) ;
3339 // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -54,7 +60,7 @@ const SeriesDetailsAccessTab = ({
5460 viewNonUsersAccessRole = { "ROLE_UI_SERIES_DETAILS_ACL_NONUSER_ROLES_VIEW" }
5561 policyChanged = { policyChanged }
5662 setPolicyChanged = { setPolicyChanged }
57- withOverrideButton = { true }
63+ withOverrideButton = { overrideEnabled }
5864 />
5965 ) ;
6066} ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ type SaveEditFooterProps = {
88 reset : ( ) => void ;
99 submit : ( ) => void ;
1010 isValid ?: boolean ;
11+ customSaveButtonText ?: ParseKeys ;
1112 additionalButton ?: {
1213 label : ParseKeys ,
1314 hint : ParseKeys ,
@@ -20,10 +21,13 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
2021 reset,
2122 submit,
2223 isValid,
24+ customSaveButtonText,
2325 additionalButton,
2426} ) => {
2527 const { t } = useTranslation ( ) ;
2628
29+ const saveButtonText = customSaveButtonText || "SAVE" ;
30+
2731 return < footer >
2832 < BaseButton
2933 onClick = { submit }
@@ -32,7 +36,7 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
3236 className = { `save green ${
3337 ! isValid || ! active ? "disabled" : ""
3438 } `}
35- > { t ( "SAVE" ) } </ BaseButton >
39+ > { t ( saveButtonText ) } </ BaseButton >
3640 { additionalButton && (
3741 < Tooltip title = { t ( additionalButton . hint ) } >
3842 < BaseButton
Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ const ResourceDetailsAccessPolicyTab = ({
378378 hint : "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.REPLACE_EVENT_ACLS_HINT" ,
379379 onClick : ( ) => saveAccess ( formik . values , true ) ,
380380 } : undefined }
381+ customSaveButtonText = { withOverrideButton ? "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.SAVE_SERIES_ACL_ONLY" : undefined }
381382 /> }
382383 </ div >
383384 ) }
Original file line number Diff line number Diff line change 12281228 "ADDITIONAL_ACTIONS" : " Additional Actions" ,
12291229 "ACTION" : " Actions" ,
12301230 "NEW" : " New policy" ,
1231+ "DETAILS" : " Details" ,
1232+ "REPLACE_EVENT_ACLS" : " Save series and overwrite event permissions" ,
1233+ "REPLACE_EVENT_ACLS_HINT" : " Save the series permissions and overwrite the permissions for all events in this series." ,
1234+ "SAVE_SERIES_ACL_ONLY" : " Save series permission" ,
12311235 "NON_USER_ROLES" : " Roles and Groups authorized for the series" ,
12321236 "USER" : " User" ,
12331237 "USERS" : " Users who are authorized for the series" ,
12341238 "NEW_USER" : " New user" ,
1235- "REPLACE_EVENT_ACLS" : " Update series permissions" ,
1236- "REPLACE_EVENT_ACLS_HINT" : " Ensure all events of this series have these permissions in effect" ,
12371239 "LOAD_MORE_LIMIT" : " policies shown." ,
12381240 "LOAD_MORE_LINK" : " Load more"
12391241 },
Original file line number Diff line number Diff line change 55 getSeriesDetailsExtendedMetadata ,
66 getStatistics ,
77} from "../selectors/seriesDetailsSelectors" ;
8+ import {
9+ getOrgProperties ,
10+ } from "../selectors/userInfoSelectors" ;
811import { addNotification } from "./notificationSlice" ;
912import {
1013 transformMetadataCollection ,
@@ -259,12 +262,19 @@ export const updateSeriesAccess = createAppAsyncThunk("seriesDetails/updateSerie
259262 id : Series [ "id" ] ,
260263 policies : { acl : Acl } ,
261264 override ?: boolean
262- } , { dispatch } ) => {
265+ } , { dispatch, getState } ) => {
263266 const { id, policies, override } = params ;
264267
265268 const data = new URLSearchParams ( ) ;
266269
267- const overrideString = override ? String ( true ) : String ( false ) ;
270+ // Here we should check for the "always" option as well, so that we can force override!
271+ const orgProperties = getOrgProperties ( getState ( ) ) ;
272+ const alwaysOverride = ( orgProperties [ "admin.series.acl.event.update.mode" ] || "optional" ) . toLowerCase ( ) === "always" ;
273+
274+ let overrideString = override ? String ( true ) : String ( false ) ;
275+ if ( alwaysOverride ) {
276+ overrideString = String ( true ) ;
277+ }
268278
269279 data . append ( "acl" , JSON . stringify ( policies ) ) ;
270280 data . append ( "override" , overrideString ) ;
You can’t perform that action at this time.
0 commit comments