@@ -58,6 +58,7 @@ only('Integration testing of the roles namespace', () => {
5858 dataPermissions : [ ] ,
5959 nodesPermissions : [ ] ,
6060 rolesPermissions : [ ] ,
61+ tenantsPermissions : [ ] ,
6162 usersPermissions : [ ] ,
6263 } ,
6364 } ,
@@ -72,6 +73,7 @@ only('Integration testing of the roles namespace', () => {
7273 dataPermissions : [ ] ,
7374 nodesPermissions : [ ] ,
7475 rolesPermissions : [ ] ,
76+ tenantsPermissions : [ ] ,
7577 usersPermissions : [ ] ,
7678 } ,
7779 } ,
@@ -97,6 +99,7 @@ only('Integration testing of the roles namespace', () => {
9799 dataPermissions : [ ] ,
98100 nodesPermissions : [ ] ,
99101 rolesPermissions : [ ] ,
102+ tenantsPermissions : [ ] ,
100103 usersPermissions : [ ] ,
101104 } ,
102105 } ,
@@ -122,6 +125,7 @@ only('Integration testing of the roles namespace', () => {
122125 ] ,
123126 nodesPermissions : [ ] ,
124127 rolesPermissions : [ ] ,
128+ tenantsPermissions : [ ] ,
125129 usersPermissions : [ ] ,
126130 } ,
127131 } ,
@@ -141,6 +145,7 @@ only('Integration testing of the roles namespace', () => {
141145 { collection : 'Some-collection' , verbosity : 'verbose' , actions : [ 'read_nodes' ] } ,
142146 ] ,
143147 rolesPermissions : [ ] ,
148+ tenantsPermissions : [ ] ,
144149 usersPermissions : [ ] ,
145150 } ,
146151 } ,
@@ -157,6 +162,7 @@ only('Integration testing of the roles namespace', () => {
157162 dataPermissions : [ ] ,
158163 nodesPermissions : [ { collection : '*' , verbosity : 'minimal' , actions : [ 'read_nodes' ] } ] ,
159164 rolesPermissions : [ ] ,
165+ tenantsPermissions : [ ] ,
160166 usersPermissions : [ ] ,
161167 } ,
162168 } ,
@@ -179,6 +185,33 @@ only('Integration testing of the roles namespace', () => {
179185 rolesPermissions : [
180186 { role : 'some-role' , actions : [ 'create_roles' , 'read_roles' , 'update_roles' , 'delete_roles' ] } ,
181187 ] ,
188+ tenantsPermissions : [ ] ,
189+ usersPermissions : [ ] ,
190+ } ,
191+ } ,
192+ {
193+ roleName : 'tenants' ,
194+ permissions : weaviate . permissions . tenants ( {
195+ collection : 'some-collection' ,
196+ create : true ,
197+ read : true ,
198+ update : true ,
199+ delete : true ,
200+ } ) ,
201+ expected : {
202+ name : 'tenants' ,
203+ backupsPermissions : [ ] ,
204+ clusterPermissions : [ ] ,
205+ collectionsPermissions : [ ] ,
206+ dataPermissions : [ ] ,
207+ nodesPermissions : [ ] ,
208+ rolesPermissions : [ ] ,
209+ tenantsPermissions : [
210+ {
211+ collection : 'Some-collection' ,
212+ actions : [ 'create_tenants' , 'read_tenants' , 'update_tenants' , 'delete_tenants' ] ,
213+ } ,
214+ ] ,
182215 usersPermissions : [ ] ,
183216 } ,
184217 } ,
@@ -197,6 +230,7 @@ only('Integration testing of the roles namespace', () => {
197230 dataPermissions : [ ] ,
198231 nodesPermissions : [ ] ,
199232 rolesPermissions : [ ] ,
233+ tenantsPermissions : [ ] ,
200234 usersPermissions : [ { users : 'some-user' , actions : [ 'assign_and_revoke_users' , 'read_users' ] } ] ,
201235 } ,
202236 } ,
@@ -218,9 +252,17 @@ only('Integration testing of the roles namespace', () => {
218252
219253 afterAll ( ( ) =>
220254 Promise . all (
221- [ 'backups' , 'cluster' , 'collections' , 'data' , 'nodes-verbose' , 'nodes-minimal' , 'roles' , 'users' ] . map (
222- ( n ) => client . roles . delete ( n )
223- )
255+ [
256+ 'backups' ,
257+ 'cluster' ,
258+ 'collections' ,
259+ 'data' ,
260+ 'nodes-verbose' ,
261+ 'nodes-minimal' ,
262+ 'roles' ,
263+ 'tenants' ,
264+ 'users' ,
265+ ] . map ( ( n ) => client . roles . delete ( n ) )
224266 )
225267 ) ;
226268} ) ;
0 commit comments