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

Only display dashboards with write permissions in add to dashboard menu #4505

Merged
merged 5 commits into from Jan 24, 2018

Conversation

@edmundoa
Copy link
Member

@edmundoa edmundoa commented Jan 23, 2018

This PR ensures users can only see dashboards with write permissions in the add to dashboard menu. Additionally it makes the state in DashboardsStore.list() consistent by using ImmutableJS in all its properties, and it ensures the permissions in DashboardsStore are set when the store is first initialized. I also added a couple of tests, to ensure all cases are doing what they should.

Fixes #4504

@edmundoa edmundoa added this to the 3.0.0 milestone Jan 23, 2018
@ghost ghost assigned edmundoa Jan 23, 2018
@edmundoa
Copy link
Member Author

@edmundoa edmundoa commented Jan 23, 2018

This PR should also be backported into the 2.4 branch.

@edmundoa
Copy link
Member Author

@edmundoa edmundoa commented Jan 23, 2018

I didn't fix all linter errors in AddToDashboardMenu.jsx because they are not related to the changes and will introduce some noise and even some possible bugs in the code.

@kmerz
Copy link
Member

@kmerz kmerz commented Jan 23, 2018

LGTM 👍

@kmerz
kmerz approved these changes Jan 24, 2018
@kmerz kmerz merged commit 9f11d8f into master Jan 24, 2018
4 of 5 checks passed
4 of 5 checks passed
@garybot2
ci-web-linter Jenkins build graylog-pr-linter-check 2205 has failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@garybot2
graylog-project/pr Jenkins build graylog-project-pr-snapshot 945 has succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@ghost ghost removed the ready-for-review label Jan 24, 2018
@kmerz kmerz deleted the issue-4504 branch Jan 24, 2018
kmerz added a commit that referenced this pull request Jan 24, 2018
…nu (#4505)

* Add tests for issue

* Only display dashboards with write access in menu

* Update current user permissions with the initial state

* Make writableDashboards consistent with dashboards

This store is using ImmutableJS to store the dashboards state, and it
should do the same with the writableDashboards

* Fix eslint errors on test
edmundoa added a commit that referenced this pull request Jan 24, 2018
…nu (#4505) (#4511)

* Add tests for issue

* Only display dashboards with write access in menu

* Update current user permissions with the initial state

* Make writableDashboards consistent with dashboards

This store is using ImmutableJS to store the dashboards state, and it
should do the same with the writableDashboards

* Fix eslint errors on test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants