Skip to content

Conversation

@charleshuang80
Copy link
Collaborator

Adds ability to choose 'No Access to Collections' for Collection Permissions

# is ~40, so 100 should be more than sufficient
filters = {
'provider' => current_user.provider_id,
'page_size' => 100
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't make assumptions about min and max sizes of lists. If you would like to default page number to 100 that's fine (though I'd prefer we stick to a more app wide default for this) but we should be paging through these results to ensure nothing is missed.

let(:perm_concept) { 'ACL4444-CMR' }

before do
permission_response = Cmr::Response.new(Faraday::Response.new(status: 200, body: JSON.parse(File.read('spec/fixtures/collection_permissions/permission_show_w_no_collections_access.json'))))
Copy link
Member

Choose a reason for hiding this comment

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

Is this something we can hit CMR for instead of mocking? When it comes to CMR I think we should mock as little as possible given the pace at which they make changes and the impact it has on us.


def construct_request_object(provider)
collection_applicable = false
if params[:collection_options] == 'all-collections' || params[:collection_options] == 'selected-ids-collections'
Copy link
Member

Choose a reason for hiding this comment

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

You are using a different method of setting a value using an if statement below on line 505 -- I prefer the method below but regardless please be consistent.

else
'all-collections'
end
else # catalog_item_identity['collection_applicable'] == false
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what this comment is for, if it's not relevant please remove it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The comment is just noting what the condition is to get to the else statement, but I can remove it.

# and at least one group with the extra permissions

before do
collections_response = Cmr::Response.new(Faraday::Response.new(status: 200, body: JSON.parse(File.read('spec/fixtures/cmr_search.json'))))
Copy link
Member

Choose a reason for hiding this comment

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

Is this something we can hit CMR for instead of mocking? When it comes to CMR I think we should mock as little as possible given the pace at which they make changes and the impact it has on us.


# PUMP can also add group permissions where the group has empty permissions so we should test that as well
context 'when the collection permission has create, update, and delete permissions as well as groups with empty permissions' do
let(:perm_concept) { 'ACL3333-CMR' }
Copy link
Member

Choose a reason for hiding this comment

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

Minor and picky but this abbreviation is misleading, suggest using full word.

@collection_access_value.each do |key, val|
if val.blank?
@collection_access_value.delete(key)
elsif val == 'true'
Copy link
Member

Choose a reason for hiding this comment

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

Is this always a string or should we be wrapping this in a boolean check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am running into this issue: http://stackoverflow.com/questions/1711547/how-to-check-if-a-param-is-true-or-false. Is there a better way to handle it?

@abbottry abbottry changed the title MMT-855 MMT-855: Adds ability to choose 'No Access to Collections' for Collection Permissions Apr 5, 2017
@charleshuang80 charleshuang80 merged commit 162aa62 into master Apr 10, 2017
@charleshuang80 charleshuang80 deleted the MMT-855 branch May 1, 2017 18:13
jdf-eos added a commit that referenced this pull request Jan 30, 2020
jdf-eos added a commit that referenced this pull request Feb 3, 2020
* Removed bourbon prefix features in set #1 (transform, transition, linear_gradient, user-select).

* Removed use of bourbon's hidpi prefix feature.

* Updated Gemfile using latest capybara.

* Revert schema.

* Fix background-* properties for linear-gradient replacements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants