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

Add annotation creation access flag #937

Merged
merged 7 commits into from
Aug 18, 2022
Merged

Add annotation creation access flag #937

merged 7 commits into from
Aug 18, 2022

Conversation

eagw
Copy link
Contributor

@eagw eagw commented Aug 17, 2022

Adds a new girder access flag which demarcates whether or not a user has permission to create annotations, allowing users to create annotations without having write access to a folder/item. Also creates a new endpoint indicating whether or not the user has creation permissions (via write access or the flag) and makes current annotation creation procedures check for the access flag.

@eagw eagw requested a review from manthey August 17, 2022 21:03
@@ -58,6 +59,10 @@ def validateBoolean(doc):
constants.PluginSettings.LARGE_IMAGE_ANNOTATION_HISTORY: True,
})

# Access flags

registerAccessFlag('createAnnots', 'Create annotations', 'Allow user to create annotations')
Copy link
Member

Choose a reason for hiding this comment

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

Can we define this access flag (the createAnnots) in girder/girder_large_image/constants.py (maybe at the root level of that modules as ANNOTATION_ACCESS_FLAG = 'large_image_create_annotations'), and then use the constant instead of the explicit string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See 99ada00

@manthey
Copy link
Member

manthey commented Aug 17, 2022

Other than preferring a defined constant to a string, this looks good.

@eagw eagw merged commit 20e0749 into master Aug 18, 2022
@eagw eagw deleted the annotation-access-flag branch August 18, 2022 13:41
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