Skip to content

properly handle view_only permission in groups API#1418

Closed
washort wants to merge 1 commit intogetredash:masterfrom
washort:groups-view-only-fix
Closed

properly handle view_only permission in groups API#1418
washort wants to merge 1 commit intogetredash:masterfrom
washort:groups-view-only-fix

Conversation

@washort
Copy link
Copy Markdown

@washort washort commented Nov 21, 2016

Cleans up an oversight in DataSource.to_dict.

if with_permissions:
d['view_only'] = self.data_source_groups.view_only
if with_permissions_for is not None:
d['view_only'] = DataSourceGroup.get(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This way we need to make another database query, while we already have the object from calling add_group/remove_group. How about we change those methods to return the DataSourceGroup object, and then assign the view_only value in the handler code?

@arikfr
Copy link
Copy Markdown
Member

arikfr commented Dec 1, 2016

Implemented in #1417.

@arikfr arikfr closed this Dec 1, 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