@@ -14,7 +14,7 @@ func (s *MethodTestSuite) TestUser() {
14
14
s .Run ("DeleteAPIKeysByUserID" , func () {
15
15
s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
16
16
u := dbgen .User (t , db , database.User {})
17
- return methodCase (inputs (u .ID ), asserts (u . UserDataRBACObject () , rbac .ActionUpdate ))
17
+ return methodCase (inputs (u .ID ), asserts (rbac . ResourceAPIKey . WithOwner ( u . ID . String ()) , rbac .ActionDelete ))
18
18
})
19
19
})
20
20
s .Run ("GetQuotaAllowanceForUser" , func () {
@@ -82,7 +82,7 @@ func (s *MethodTestSuite) TestUser() {
82
82
return methodCase (inputs (database.InsertUserParams {
83
83
ID : uuid .New (),
84
84
LoginType : database .LoginTypePassword ,
85
- }), asserts (rbac .ResourceUser , rbac .ActionCreate ))
85
+ }), asserts (rbac .ResourceRoleAssignment , rbac . ActionCreate , rbac . ResourceUser , rbac .ActionCreate ))
86
86
})
87
87
})
88
88
s .Run ("InsertUserLink" , func () {
@@ -114,7 +114,7 @@ func (s *MethodTestSuite) TestUser() {
114
114
u := dbgen .User (t , db , database.User {})
115
115
return methodCase (inputs (database.UpdateUserHashedPasswordParams {
116
116
ID : u .ID ,
117
- }), asserts (u , rbac .ActionUpdate ))
117
+ }), asserts (u . UserDataRBACObject () , rbac .ActionUpdate ))
118
118
})
119
119
})
120
120
s .Run ("UpdateUserLastSeenAt" , func () {
@@ -185,14 +185,14 @@ func (s *MethodTestSuite) TestUser() {
185
185
return methodCase (inputs (database.InsertGitAuthLinkParams {
186
186
ProviderID : uuid .NewString (),
187
187
UserID : u .ID ,
188
- }), asserts (rbac .ResourceUserData .WithOwner (u .ID .String ()).WithID (u .ID ), rbac .ActionRead ))
188
+ }), asserts (rbac .ResourceUserData .WithOwner (u .ID .String ()).WithID (u .ID ), rbac .ActionCreate ))
189
189
})
190
190
})
191
191
s .Run ("UpdateGitAuthLink" , func () {
192
192
s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
193
193
link := dbgen .GitAuthLink (t , db , database.GitAuthLink {})
194
194
return methodCase (inputs (database.UpdateGitAuthLinkParams {
195
- ProviderID : uuid . NewString () ,
195
+ ProviderID : link . ProviderID ,
196
196
UserID : link .UserID ,
197
197
}), asserts (link , rbac .ActionUpdate ))
198
198
})
0 commit comments