Fix issue:- #5617 Only owner and admin should allow to make changes in entity and service (#5625)

This commit is contained in:
Shailesh Parmar 2022-06-24 23:14:07 +05:30 committed by GitHub
parent ace12501b4
commit b29911a373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 7 deletions

View File

@ -116,7 +116,6 @@ const MyAssetStats: FunctionComponent<Props> = ({
count: countTeams,
link: getTeamAndUserDetailsPath(),
dataTestId: 'terms',
adminOnly: true,
},
};
};

View File

@ -435,9 +435,8 @@ export const navLinkSettings = [
name: 'Teams & Users',
to: ROUTES.TEAMS_AND_USERS,
disabled: false,
isAdminOnly: true,
},
{ name: 'Webhooks', to: '/webhooks', disabled: false },
{ name: 'Webhooks', to: '/webhooks', disabled: false, isAdminOnly: true },
];
export const TITLE_FOR_NON_OWNER_ACTION =

View File

@ -20,7 +20,7 @@ export const STEPS_FOR_ADD_INGESTION: Array<StepperStepType> = [
{ name: 'Schedule Interval', step: 3 },
];
export const INGESTION_SCHEDULER_INITIAL_VALUE = '5 * * * *';
export const INGESTION_SCHEDULER_INITIAL_VALUE = '0 * * * *';
export const INITIAL_FILTER_PATTERN: FilterPattern = {
includes: [],

View File

@ -684,7 +684,10 @@ const TeamsAndUsersPage = () => {
useEffect(() => {
if (!isDataLoading) {
if (teamAndUser) {
if (Object.values(UserType).includes(teamAndUser as UserType)) {
if (
Object.values(UserType).includes(teamAndUser as UserType) &&
(isAdminUser || isAuthDisabled)
) {
setIsTeamVisible(false);
setactiveUserTab(teamAndUser as UserType);
setCurrentTeam({} as Team);

View File

@ -156,12 +156,12 @@ const AuthenticatedAppRouter: FunctionComponent = () => {
<Route exact component={ExplorePage} path={ROUTES.EXPLORE} />
<Route component={ExplorePage} path={ROUTES.EXPLORE_WITH_SEARCH} />
<Route component={ExplorePage} path={ROUTES.EXPLORE_WITH_TAB} />
<AdminProtectedRoute
<Route
exact
component={TeamsAndUsersPage}
path={ROUTES.TEAMS_AND_USERS}
/>
<AdminProtectedRoute
<Route
exact
component={TeamsAndUsersPage}
path={ROUTES.TEAMS_AND_USERS_DETAILS}

View File

@ -65,6 +65,7 @@ export const formatUsersResponse = (hits) => {
email: d._source.email,
type: d._source.entity_type,
id: d._source.user_id,
teams: d._source.teams,
};
});
};