@@ -91,6 +91,7 @@ def update_collection(self, collections: list[UUID]):
9191class CollectionAccess (BitwardenBaseModel ):
9292 ReadOnly : bool = False
9393 HidePasswords : bool = False
94+ Manage : bool = False
9495
9596
9697class CollectionUser (CollectionAccess ):
@@ -154,6 +155,7 @@ def set_users(
154155 users : list [CollectionUser ] | list [UUID ],
155156 default_readonly : bool = False ,
156157 default_hide_passwords : bool = False ,
158+ default_manage : bool = False ,
157159 ):
158160 users_payload = []
159161 if users is not None and len (users ) > 0 :
@@ -172,6 +174,7 @@ def set_users(
172174 "id" : str (user_id ),
173175 "readOnly" : default_readonly ,
174176 "hidePasswords" : default_hide_passwords ,
177+ "manage" : default_manage ,
175178 }
176179 for user_id in users
177180 ]
@@ -203,6 +206,7 @@ class OrganizationUserDetails(BitwardenBaseModel):
203206 Collections : list [UserCollection ]
204207 Groups : list | None = None
205208 TwoFactorEnabled : bool
209+ Permissions : dict | None = None
206210
207211 @field_validator ("OrganizationId" )
208212 @classmethod
@@ -221,6 +225,7 @@ def add_collections(self, collections: list[UUID]):
221225 UserId = self .Id ,
222226 ReadOnly = False ,
223227 HidePasswords = False ,
228+ Manage = False
224229 )
225230 user .bitwarden_client = self .api_client
226231 self .Collections .append (user )
@@ -231,6 +236,7 @@ def add_collections(self, collections: list[UUID]):
231236 "CollectionId" : True ,
232237 "ReadOnly" : True ,
233238 "HidePasswords" : True ,
239+ "Manage" : True ,
234240 }
235241 },
236242 "Groups" : True ,
@@ -348,9 +354,13 @@ def invite(
348354 ) = None ,
349355 access_all : bool = False ,
350356 user_type : OrganizationUserType = OrganizationUserType .User ,
357+ permissions = None ,
351358 default_readonly : bool = False ,
352359 default_hide_passwords : bool = False ,
360+ default_manage : bool = False ,
353361 ):
362+ if permissions is None :
363+ permissions = {}
354364 collections_payload = []
355365 if collections is not None and len (collections ) > 0 :
356366 for coll in collections :
@@ -378,6 +388,7 @@ def invite(
378388 "id" : coll_id ,
379389 "readOnly" : default_readonly ,
380390 "hidePasswords" : default_hide_passwords ,
391+ "manage" : default_manage ,
381392 }
382393 )
383394
@@ -387,6 +398,7 @@ def invite(
387398 "type" : user_type ,
388399 "collections" : collections_payload ,
389400 "groups" : [],
401+ "permissions" : permissions ,
390402 }
391403 resp = self .api_client .api_request (
392404 "POST" , f"api/organizations/{ self .Id } /users/invite" , json = payload
0 commit comments