question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[admin] Only organizationuser objects which have admin=True should be able to manage their organization in the admin

See original GitHub issue

It could happen that a user which has is_staff set to True becomes member of another organization because he wants to use some service (implemented in other openwisp modules) of that organization as a user, but at the moment we can’t let that happen because in the moment he become member of that organization he will also be able to edit the objects of that organization from the admin.

To solve this problem, we should change the code so that only OrganizationUser objects which are both member of an organization and have is_admin set to True are able to see and edit the objects of that organization.

When OrganizationUser.is_admin is set to False the user won’t be allowed to see anything related to that organization in the admin.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
nemesisdesigncommented, Oct 19, 2018

@OltarzewskiK up to you, there are no requirements in open source, contributors contribute when they can. If someone else comes up and can finish this issue before you do we shouldn’t prevent them from doing so, because it’s more important to fix the issue than who fixes it, I’ll send you some suggestions via PM

0reactions
strang1atocommented, Dec 8, 2018

@nemesisdesign Are you sure that I have to change this method: https://github.com/openwisp/openwisp-users/blob/master/openwisp_users/admin.py#L195-L213 the class where it is referring to is I think for Usernot OrganizationUser, so have I to create new class in the admin?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an admin role for an organizational unit - Google Help
As your organization's administrator, you can assign a user to a custom administrator role so they can perform management tasks for an organizational...
Read more >
About admin roles in the Microsoft 365 admin center
Select the Assigned or Assigned admins tab to add users to roles. You'll probably only need to assign the following roles in your...
Read more >
Knife user creation doesn't work in Chef 12 · Issue #3010
The short answer: You probably want to either (1) use chef-server-ctl user-create or (2) temporarily configure your knife client to such ...
Read more >
How do I build a collection of Users for an Organization using ...
Upon first creating an account the User becomes Admin of the Organization and is able to add other Users that belong_to the same...
Read more >
Admin Users API - Terraform Enterprise - HashiCorp Developer
The Users Admin API contains endpoints to help site administrators manage ... Can be "true" or "false" to show only suspended users or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found