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

Check User permissions for private group #5801

Closed
t-book opened this issue Mar 4, 2020 · 11 comments
Closed

Check User permissions for private group #5801

t-book opened this issue Mar 4, 2020 · 11 comments
Assignees
Labels
minor A low priority issue which might affect only some users and /or not the main functionality security Pull requests that address a security vulnerability
Milestone

Comments

@t-book
Copy link
Contributor

t-book commented Mar 4, 2020

Describe the solution you'd like
GroupDetailView should check if group is private and if user is member.

@t-book t-book added security Pull requests that address a security vulnerability minor A low priority issue which might affect only some users and /or not the main functionality labels Mar 4, 2020
@t-book
Copy link
Contributor Author

t-book commented Mar 4, 2020

@afabiani one more minor issue found in permissions form:

Bildschirmfoto 2020-03-04 um 21 52 15

would change json_dict['groups'] in Ajax_lookup to something like

    json_dict['groups'] = [({'name': g.slug, 'title': g.title})
                           for g in groups
                           if g.user_is_member(request.user) 
                           or g.access == "public"]

or maybe better in the inital db query to avoid to many database hits?

@gannebamm
Copy link
Contributor

Sidenote: Groups will be displayed on LayerDetailViews and the LayerListView, too. From there Links are displayed which would lead to a dead end, if the above is implemented.

@t-book
Copy link
Contributor Author

t-book commented Mar 5, 2020

@gannebamm not sure about it.
check: https://master.demo.geonode.org/layers/geonode_data:geonode:empty_layer

Bildschirmfoto 2020-03-05 um 11 54 20
Bildschirmfoto 2020-03-05 um 11 54 27

The private group is not showing up ad layer detail.

@afabiani afabiani added this to the 3.x milestone May 11, 2020
@gannebamm
Copy link
Contributor

Same here @sjohn-atenekom :
Could you test this behaviour? I think those security-related issues are relevant for AteneKOM? This help would be very much appreciated :D

@ghost
Copy link

ghost commented Nov 3, 2020

I could reproduce the problem. a user can assign the permissions for a private group in which he is not a member.
But what do you mean by this, @gannebamm?

Sidenote: Groups will be displayed on LayerDetailViews and the LayerListView, too. From there Links are displayed which would lead to a dead end, if the above is implemented.

@afabiani
Copy link
Member

afabiani commented Nov 3, 2020

This behavior is enabled only when you set the GROUP_PRIVATE_RESOURCES to True

This is part of a set of 4 settings which allow you to enable (partially or fully) and advanced data validation workflow

@gannebamm
Copy link
Contributor

But what do you mean by this, @gannebamm?

Sidenote: Groups will be displayed on LayerDetailViews and the LayerListView, too. From there Links are displayed which would lead to a dead end, if the above is implemented.

I can not reproduce this old behaviour I seem to have spotted.

I could reproduce the problem. a user can assign the permissions for a private group in which he is not a member.

I can reproduce this issue of seeing a private group in the permissions, too. I think this is an issue since the documentation states (https://docs.geonode.org/en/master/admin/admin_panel/index.html#types-of-groups):
Private: only invited users can join the group, registered users cannot see any details about the group, including membership.

@afabiani I think GROUP_PRIVATE_RESOURCES will make all resources inside a group non-visible by non-group users. This is a good switch but not related to this issue I think.

So you should not be able to see private groups if you are not a member of them. I would vote for @t-book idea to check in the template, or on the sql query side for group visibility permissions.

@gannebamm
Copy link
Contributor

Same for linking dokuments:
Image_2020_11_04___001
I can see private groups in the autocomplete, even though I am not a member of them. This is with enabled GROUP_PRIVATE_RESOURCES.

@t-book
Copy link
Contributor Author

t-book commented Nov 6, 2020

@gannebamm Confirmed. Private groups do show up for non group members (GROUP_PRIVATE_RESOURCES=True). My understanding is a private group should be private. In other words non members should not even know of the group existence. If you and @afabiani agree I would follow up with my patch here and create a PR: #5801 (comment)

@gannebamm
Copy link
Contributor

Yes, that is my understanding of private groups, too. They shouldn't be visible by anyone except members.

@afabiani
Copy link
Member

afabiani commented Nov 9, 2020

Yes, this is correct. They should show-up only if the user is currently a member or manager of the group.

github-actions bot pushed a commit that referenced this issue Nov 16, 2020
* [Fixes #5801] Check User permissions for private group

* [Fixes #5801] Check User permissions for private group: tests

* [Fixes #5801] Check User permissions for private group: tests
afabiani pushed a commit that referenced this issue Nov 16, 2020
* [Fixes #5801] Check User permissions for private group

* [Fixes #5801] Check User permissions for private group: tests

* [Fixes #5801] Check User permissions for private group: tests

Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor A low priority issue which might affect only some users and /or not the main functionality security Pull requests that address a security vulnerability
Projects
None yet
Development

No branches or pull requests

3 participants