File tree 4 files changed +9
-4
lines changed 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import * as ReimbursementAccountProps from './reimbursementAccountPropTypes';
32
32
import reimbursementAccountDraftPropTypes from './ReimbursementAccountDraftPropTypes' ;
33
33
import withPolicy from '../workspace/withPolicy' ;
34
34
import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView' ;
35
+ import * as Policy from '../../libs/actions/Policy' ;
35
36
36
37
const propTypes = {
37
38
/** Plaid SDK token to use to initialize the widget */
@@ -330,12 +331,13 @@ class ReimbursementAccountPage extends React.Component {
330
331
const currentStep = achData . currentStep || CONST . BANK_ACCOUNT . STEP . BANK_ACCOUNT ;
331
332
const policyName = lodashGet ( this . props . policy , 'name' ) ;
332
333
333
- if ( _ . isEmpty ( this . props . policy ) ) {
334
+ if ( _ . isEmpty ( this . props . policy ) || ! Policy . isPolicyOwner ( this . props . policy ) ) {
334
335
return (
335
336
< ScreenWrapper >
336
337
< FullPageNotFoundView
337
338
shouldShow
338
339
onBackButtonPress = { ( ) => Navigation . navigate ( ROUTES . SETTINGS_WORKSPACES ) }
340
+ subtitleKey = { _ . isEmpty ( this . props . policy ) ? undefined : 'workspace.common.notAuthorized' }
339
341
shouldShowLink
340
342
/>
341
343
</ ScreenWrapper >
Original file line number Diff line number Diff line change @@ -158,7 +158,8 @@ class WorkspaceInviteMessagePage extends React.Component {
158
158
return (
159
159
< ScreenWrapper includeSafeAreaPaddingBottom = { false } >
160
160
< FullPageNotFoundView
161
- shouldShow = { _ . isEmpty ( this . props . policy ) }
161
+ shouldShow = { _ . isEmpty ( this . props . policy ) || ! Policy . isPolicyOwner ( this . props . policy ) }
162
+ subtitleKey = { _ . isEmpty ( this . props . policy ) ? undefined : 'workspace.common.notAuthorized' }
162
163
onBackButtonPress = { ( ) => Navigation . goBack ( ROUTES . SETTINGS_WORKSPACES ) }
163
164
>
164
165
< HeaderWithBackButton
Original file line number Diff line number Diff line change @@ -272,7 +272,8 @@ class WorkspaceInvitePage extends React.Component {
272
272
const sections = didScreenTransitionEnd ? this . getSections ( ) : [ ] ;
273
273
return (
274
274
< FullPageNotFoundView
275
- shouldShow = { _ . isEmpty ( this . props . policy ) }
275
+ shouldShow = { _ . isEmpty ( this . props . policy ) || ! Policy . isPolicyOwner ( this . props . policy ) }
276
+ subtitleKey = { _ . isEmpty ( this . props . policy ) ? undefined : 'workspace.common.notAuthorized' }
276
277
onBackButtonPress = { ( ) => Navigation . goBack ( ROUTES . SETTINGS_WORKSPACES ) }
277
278
>
278
279
< HeaderWithBackButton
Original file line number Diff line number Diff line change @@ -404,7 +404,8 @@ function WorkspaceMembersPage(props) {
404
404
>
405
405
{ ( { safeAreaPaddingBottomStyle} ) => (
406
406
< FullPageNotFoundView
407
- shouldShow = { _ . isEmpty ( props . policy ) }
407
+ shouldShow = { _ . isEmpty ( props . policy ) || ! Policy . isPolicyOwner ( props . policy ) }
408
+ subtitleKey = { _ . isEmpty ( props . policy ) ? undefined : 'workspace.common.notAuthorized' }
408
409
onBackButtonPress = { ( ) => Navigation . goBack ( ROUTES . SETTINGS_WORKSPACES ) }
409
410
>
410
411
< HeaderWithBackButton
You can’t perform that action at this time.
0 commit comments