-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Add User.groups
and Group.members
#341
Conversation
`User.groups` needs access to `client` to ask `client.groups`.
b59c689
to
6651301
Compare
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this
I understand that circular reference/dependency is an issue, but could you say more about how/why this particular addition makes us bump into it?
Up until now, functions have been fairly isolated. However, gathering all of the groups a To get around this, I added the The problem comes in where a When the child We could adjust the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional changes look good
…bers.add(user)`, and `group.members.delete(user)`
Following comment from other PR. Am going to only allow for add / delete to accept a single user/group object. This makes is very clear as to what is happening. |
Fixes #340
Related https://github.com/rstudio/connect/issues/28176
Added
Group
Group.members.find()
- Retrieve all users for a given groupGroup.members.add(user)
- Add user to a groupGroup.members.delete(user)
- Remove user form a groupUser
Users.groups.find()
- Retrieve all groups for a given userUser.groups.add(group)
- Add user to a groupUser.groups.delete(group)
- Remove user from a groupOther changes
Context
class addedself.ctx = weakref.proxy(client)
Client -> Context -> Client
circular dependency is made quickly. By having theContext -> Client
be weak, then theContext
will only disappear once the parentClient
wants to be gc'd..destroy(*permissions)
was changed to.destroy(permission)
to follow pattern of how a single user can be added to a single group. Similarly, destroying multiple permissions in one method is no faster through the API than looping through and destorying single permissions individually.