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

Convert Vmdb::PermissionsStore to a blacklist #19053

Merged
merged 1 commit into from
Jul 24, 2019

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Jul 24, 2019

It's uncommon to prevent features, so the permissions store works better as a blacklist. Otherwise, we are forced to add new items to the whitelist everytime we add things, even when most of the time we actually want them.

Other repos should not need to change except that I will need to change our production whitelist to a blacklist after this is merged.

@gtanzillo Please review.
cc @h-kataria @martinpovolny @agrare

end

def can?(permission)
@permissions.include?(permission)
!@blacklist.include?(permission)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to tell, but the big change is the ! here.

@Fryguy Fryguy force-pushed the blacklist_permissions_store branch 2 times, most recently from d501369 to eedcd65 Compare July 24, 2019 19:11
Since it's now a blacklist, there's no need for a sample file with the
full possible whitelist
@Fryguy Fryguy force-pushed the blacklist_permissions_store branch from eedcd65 to de224fd Compare July 24, 2019 19:13
@miq-bot
Copy link
Member

miq-bot commented Jul 24, 2019

Checked commit Fryguy@de224fd with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. ⭐

@agrare
Copy link
Member

agrare commented Jul 24, 2019

Looks like a sporadic failure https://travis-ci.org/ManageIQ/manageiq/jobs/563230333#L694-L703

@agrare agrare closed this Jul 24, 2019
@agrare agrare reopened this Jul 24, 2019
@martinpovolny
Copy link
Member

Looks good to me.

@h-kataria h-kataria added this to the Sprint 117 Ending Aug 5, 2019 milestone Jul 24, 2019
@h-kataria h-kataria merged commit 7146738 into ManageIQ:master Jul 24, 2019
@mzazrivec
Copy link
Contributor

This causes CI failure in ui-classic:

ApplicationHelper#role_allows? permission store consults the permission store
     Failure/Error: expect(Menu::DefaultMenu.services_menu_section.visible?).to be_truthy
     
       expected: truthy value
            got: false
     # ./spec/helpers/application_helper_spec.rb:62:in `block (5 levels) in <top (required)>'
     # ./spec/helpers/application_helper_spec.rb:50:in `block (4 levels) in <top (required)>'

@Fryguy
Copy link
Member Author

Fryguy commented Jul 25, 2019

@martinpovolny @himdel Gah! I said to myself "you know, I should run the UI tests before this gets merged". If I had my bot-driven test system in place, it wouldn't have been a thought...I would have just done it. 😠

@Fryguy Fryguy deleted the blacklist_permissions_store branch July 25, 2019 17:21
@martinpovolny
Copy link
Member

martinpovolny commented Jul 26, 2019

Even better, if one the Ruby travis tasks from UI ran on each core PR ;-) (just 15 minutes of execution)

simaishi pushed a commit that referenced this pull request Jul 26, 2019
Convert Vmdb::PermissionsStore to a blacklist

(cherry picked from commit 7146738)
@simaishi
Copy link
Contributor

Ivanchuk backport details:

$ git log -1
commit 35c69a6a65529345191349f64662d0482de29e08
Author: Harpreet Kataria <hkataria@redhat.com>
Date:   Wed Jul 24 19:49:47 2019 -0400

    Merge pull request #19053 from Fryguy/blacklist_permissions_store
    
    Convert Vmdb::PermissionsStore to a blacklist
    
    (cherry picked from commit 7146738a0ae43b586b883480d42d5ff2c39dd96c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants