Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors when multiple cf's are connected as both admin and non-admin users #2409

Merged
merged 2 commits into from
Jun 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/frontend/app/store/effects/permissions.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ export class PermissionsEffects {
// Per endpoint fetch feature flags and user roles (unless admin, where we don't need to), then mark endpoint as initialised
endpoints.forEach(endpoint => {
if (endpoint.user.admin) {
requests[endpoint.guid].push(observableOf(true));
// We don't need permissions for admin users (they can do everything)
requests[endpoint.guid] = [observableOf(true)];
this.store.dispatch(new GetUserCfRelations(endpoint.guid, GET_CURRENT_USER_CF_RELATIONS_SUCCESS));
} else {
// START fetching cf roles for current user
this.store.dispatch(new GetUserCfRelations(endpoint.guid, GET_CURRENT_USER_CF_RELATIONS));
Expand Down