ckan/ckan — pull request #1664 by wardi (2014-04-23 22:34:04+00:00)
Title: Fix package permission checks for create+update

My interpretation of the three configuration options affecting whether a package create+update will be allowed:

CUD
create_unowned_dataset

CDNIO
create_dataset_if_not_in_organization

ACD
anon_create_dataset

| CUD | CDNIO | ACD | anon user | user not in org | user in org |
|:---:|:---:|:---:|:---:|:---:|:---:|
| False | * | * | :x: | :x: | :white_check_mark: |
| True | False | False | :x: | :x: | :white_check_mark: |
| True | False | True | :x: | :x: | :white_check_mark: |
| True | True | False | :x: | :white_check_mark: | :white_check_mark: |
| True | True | True | :white_check_mark: | :white_check_mark: | :white_check_mark: |

This PR implements the checks described in the table above and uses the same code in both create and update operations. The original checks did not cover a number of the combinations possible. One could argue that users shouldn't set permissions certain ways, but I'd rather not have CKAN fail when they do.