Improvements to PR #246 (hiding the "Upload" tab) #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Lying in bed last night, it came to me that a better way to implement the goals of PR #246 was simply to disable the
upload
,upload-submit
, andadd_file
views on contexts for whichFile
resources are not sdi-addable. (PR #246 just hides the Upload tab, the views are still accessible, even though invoking these views would not be appropriate.)This PR adds a new view predicate which checks the context to see whether a specific content type is sdi-addable. This predicate is then used to protect the previously mentioned views. (I'm not sure that the name of the predicate,
sdi_addable
, is the best choice. Suggestions welcome.)I've also renamed the new function
content_type_addable
, introduced in #246, tois_sdi_addable
to more closely match the name of the view predicate.