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

AdminPermission is_admin permission mismatch with views permissions #4399

Closed
xrmx opened this issue Jul 18, 2018 · 12 comments
Closed

AdminPermission is_admin permission mismatch with views permissions #4399

xrmx opened this issue Jul 18, 2018 · 12 comments
Labels
Status: stale Issue will be considered inactive soon

Comments

@xrmx
Copy link
Contributor

xrmx commented Jul 18, 2018

Details

If i am a superuser i see all the content that is guarded by the is_admin template tag even if i am not an admin of the project. is_admin is just a wrapper of core.permissions. AdminPermission and in fact the behavior matches the code.
The problem is that this access control does not match the one in the build views. e.g. In the project detail page i see the build version button but when i click it i get a 404. Same for updating project details.
Any idea on how to fix this?

Expected Result

As a superuser if i cannot build a project i shouldn't see the button for doing so

Actual Result

As a superuser a button that leds to a 404 is showed to me

@humitos
Copy link
Member

humitos commented Jul 23, 2018

Being a super user we can trigger builds from another projects (I've been doing that) but the problem you mentioned is with the "Admin" button that it's shown but when clicked you see a 404.

The trigger button was fixed by @davidfischer at #4207

I think that Admin button shouldn't be shown at all.

@xrmx
Copy link
Contributor Author

xrmx commented Jul 24, 2018

@humitos missed that, thanks! Will check and close the bug if that's it.

@xrmx
Copy link
Contributor Author

xrmx commented Jul 24, 2018

For us it's not just the project admin button it's also the link to projects.views.private.project_version_detail for each version.

@xrmx
Copy link
Contributor Author

xrmx commented Jul 24, 2018

We would like being able to inspect our users projects, are you willing to consider a PR that permit that? Like what David did but for the other two views.

@xrmx
Copy link
Contributor Author

xrmx commented Jul 24, 2018

We need something like this italia@5a76034

We need to add another method to the queryset manager because for_admin_user is also used when we need to really pick projects from the user, e.g. import views.

@humitos
Copy link
Member

humitos commented Jul 24, 2018

In that case, this needs a deeper look since we extend the for_admin_user in our corporate site (to respect another kind of permissions) and we will need to make sure that is still supported after the changes needed for this here.

@xrmx
Copy link
Contributor Author

xrmx commented Jul 25, 2018

So this is what i come up:
italia#89

First commit is backport of David fix, the second does the same to more views and the last add the new queryset method that calls the old one so it may work even with your overridings. If it is interesting for you i can open a PR upstream of course.

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@xrmx
Copy link
Contributor Author

xrmx commented Jan 10, 2019

I think this is still valid

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@stale
Copy link

stale bot commented Feb 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Feb 24, 2019
@stsewd stsewd removed the Status: stale Issue will be considered inactive soon label Feb 25, 2019
@stale
Copy link

stale bot commented Apr 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Apr 11, 2019
@stale stale bot closed this as completed Apr 18, 2019
@stsewd
Copy link
Member

stsewd commented Apr 19, 2019

We are planning in refactor the auth code, so it's easier to use/extend. Not sure if we should re-open this issue or wait for the refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: stale Issue will be considered inactive soon
Projects
None yet
Development

No branches or pull requests

3 participants