Skip to content

In tree save/edit, post only writable fields#285

Merged
RickMohr merged 1 commit intoOpenTreeMap:masterfrom
RickMohr:post-only-writable-fields
Mar 7, 2016
Merged

In tree save/edit, post only writable fields#285
RickMohr merged 1 commit intoOpenTreeMap:masterfrom
RickMohr:post-only-writable-fields

Conversation

@RickMohr
Copy link
Copy Markdown
Contributor

@RickMohr RickMohr commented Mar 4, 2016

Connects #263

Testing:

  • Make an instance whose public role can upload photos but nothing else
  • Verify that a public user can upload an image
  • Verify that an admin user can still create and edit trees

NSMutableDictionary *writableData = [[NSMutableDictionary alloc] init];
NSDictionary *fieldData = [[OTMEnvironment sharedEnvironment] fieldData];

for (NSString *model in [NSArray arrayWithObjects:@"plot", @"tree", nil]) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be shortened with an array literal

for (NSString *model in @[@"plot", @"tree"]) {

@jwalgran
Copy link
Copy Markdown
Contributor

jwalgran commented Mar 7, 2016

I recreated the "public user can't save a photo" error on the master branch and verified that it was resolved on this branch.

When logged in as a privileged user I was still able to save edits to all fields including stewardship and alerts.

Nice implementation.

👍

@jwalgran jwalgran assigned RickMohr and unassigned jwalgran Mar 7, 2016
Connects #263

Testing:
* Make an instance whose `public` role can upload photos but nothing else
* Verify that a `public` user can upload an image
* Verify that an admin user can still create and edit trees
RickMohr added a commit that referenced this pull request Mar 7, 2016
In tree save/edit, post only writable fields
@RickMohr RickMohr merged commit 59a0c7c into OpenTreeMap:master Mar 7, 2016
@RickMohr RickMohr deleted the post-only-writable-fields branch March 7, 2016 20:12
@RickMohr RickMohr removed the in review label Mar 7, 2016
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.

2 participants