mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Fix observers not being allowed access to policies (#11071)
This commit is contained in:
parent
670492c129
commit
0deed1f112
@ -16,7 +16,12 @@ export default PropTypes.shape({
|
||||
teams: PropTypes.arrayOf(teamInterface),
|
||||
});
|
||||
|
||||
export const USERS_ROLES = ["admin", "maintainer", "observer"] as const;
|
||||
export const USERS_ROLES = [
|
||||
"admin",
|
||||
"maintainer",
|
||||
"observer",
|
||||
"observer_plus",
|
||||
] as const;
|
||||
export type IUserRole = typeof USERS_ROLES[number];
|
||||
export type UserRole =
|
||||
| "admin"
|
||||
|
@ -49,6 +49,7 @@ const AgentOptionsPage = ({
|
||||
admin: true,
|
||||
maintainer: false,
|
||||
observer: false,
|
||||
observer_plus: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -64,6 +64,7 @@ const MembersPage = ({ location, router }: IMembersPageProps): JSX.Element => {
|
||||
admin: true,
|
||||
maintainer: false,
|
||||
observer: false,
|
||||
observer_plus: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -117,6 +117,7 @@ const TeamDetailsWrapper = ({
|
||||
admin: true,
|
||||
maintainer: false,
|
||||
observer: false,
|
||||
observer_plus: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -53,6 +53,7 @@ const ManagePolicyPage = ({
|
||||
location,
|
||||
}: IManagePoliciesPageProps): JSX.Element => {
|
||||
const {
|
||||
currentUser,
|
||||
isGlobalAdmin,
|
||||
isGlobalMaintainer,
|
||||
isOnGlobalTeam,
|
||||
@ -62,6 +63,8 @@ const ManagePolicyPage = ({
|
||||
} = useContext(AppContext);
|
||||
const { renderFlash } = useContext(NotificationContext);
|
||||
|
||||
console.log("currentUser: ", currentUser);
|
||||
|
||||
const {
|
||||
setLastEditedQueryName,
|
||||
setLastEditedQueryDescription,
|
||||
@ -89,7 +92,8 @@ const ManagePolicyPage = ({
|
||||
permittedAccessByTeamRole: {
|
||||
admin: true,
|
||||
maintainer: true,
|
||||
observer: false,
|
||||
observer: true,
|
||||
observer_plus: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -77,7 +77,8 @@ const PolicyPage = ({
|
||||
permittedAccessByTeamRole: {
|
||||
admin: true,
|
||||
maintainer: true,
|
||||
observer: false,
|
||||
observer: true,
|
||||
observer_plus: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -141,6 +141,7 @@ const ManageSchedulePage = ({
|
||||
admin: true,
|
||||
maintainer: true,
|
||||
observer: false,
|
||||
observer_plus: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user