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 style = { { padding : "0 15px" } } >
2832 { active && isValid && (
2933 < div className = "pull-left" >
@@ -56,7 +60,7 @@ export const SaveEditFooter: React.FC<SaveEditFooterProps> = ({
5660 className = { `save green ${
5761 ! isValid || ! active ? "disabled" : ""
5862 } `}
59- > { t ( "SAVE" ) } </ BaseButton >
63+ > { t ( saveButtonText ) } </ BaseButton >
6064 </ div >
6165 </ footer > ;
6266} ;
Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ const ResourceDetailsAccessPolicyTab = ({
376376 hint : "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.REPLACE_EVENT_ACLS_HINT" ,
377377 onClick : ( ) => saveAccess ( formik . values , true ) ,
378378 } : undefined }
379+ customSaveButtonText = { withOverrideButton ? "EVENTS.SERIES.DETAILS.ACCESS.ACCESS_POLICY.SAVE_SERIES_ACL_ONLY" : undefined }
379380 /> }
380381 </ div >
381382 ) }
Original file line number Diff line number Diff line change 12251225 "ADDITIONAL_ACTIONS" : " Additional Actions" ,
12261226 "ACTION" : " Actions" ,
12271227 "NEW" : " New policy" ,
1228+ "DETAILS" : " Details" ,
1229+ "REPLACE_EVENT_ACLS" : " Save series and overwrite event permissions" ,
1230+ "REPLACE_EVENT_ACLS_HINT" : " Save the series permissions and overwrite the permissions for all events in this series." ,
1231+ "SAVE_SERIES_ACL_ONLY" : " Save series permission" ,
12281232 "NON_USER_ROLES" : " Roles and Groups authorized for the series" ,
12291233 "USER" : " User" ,
12301234 "USERS" : " Users who are authorized for the series" ,
12311235 "NEW_USER" : " New user" ,
1232- "REPLACE_EVENT_ACLS" : " Update series permissions" ,
1233- "REPLACE_EVENT_ACLS_HINT" : " Ensure all events of this series have these permissions in effect" ,
12341236 "LOAD_MORE_LIMIT" : " policies shown." ,
12351237 "LOAD_MORE_LINK" : " Load more"
12361238 },
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 ,
@@ -258,12 +261,19 @@ export const updateSeriesAccess = createAppAsyncThunk("seriesDetails/updateSerie
258261 id : Series [ "id" ] ,
259262 policies : { acl : Acl } ,
260263 override ?: boolean
261- } , { dispatch } ) => {
264+ } , { dispatch, getState } ) => {
262265 const { id, policies, override } = params ;
263266
264267 const data = new URLSearchParams ( ) ;
265268
266- const overrideString = override ? String ( true ) : String ( false ) ;
269+ // Here we should check for the "always" option as well, so that we can force override!
270+ const orgProperties = getOrgProperties ( getState ( ) ) ;
271+ const alwaysOverride = ( orgProperties [ "admin.series.acl.event.update.mode" ] || "optional" ) . toLowerCase ( ) === "always" ;
272+
273+ let overrideString = override ? String ( true ) : String ( false ) ;
274+ if ( alwaysOverride ) {
275+ overrideString = String ( true ) ;
276+ }
267277
268278 data . append ( "acl" , JSON . stringify ( policies ) ) ;
269279 data . append ( "override" , overrideString ) ;
You can’t perform that action at this time.
0 commit comments