Skip to content

Commit 23daa68

Browse files
committed
fix rbac roles
1 parent 4b674a8 commit 23daa68

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4611,8 +4611,27 @@ func (s *MethodTestSuite) TestNotifications() {
46114611
}))
46124612

46134613
s.Run("InsertInboxNotification", s.Subtest(func(_ database.Store, check *expects) {
4614-
owner := uuid.UUID{}
4615-
check.Args(database.InsertInboxNotificationParams{}).Asserts(rbac.ResourceInboxNotification.WithOwner(owner.String()), policy.ActionCreate)
4614+
u := dbgen.User(s.T(), db, database.User{})
4615+
o := dbgen.Organization(s.T(), db, database.Organization{})
4616+
tpl := dbgen.Template(s.T(), db, database.Template{
4617+
OrganizationID: o.ID,
4618+
CreatedBy: u.ID,
4619+
})
4620+
4621+
notifID := uuid.New()
4622+
4623+
targets := []uuid.UUID{u.ID, tpl.ID}
4624+
4625+
check.Args(database.InsertInboxNotificationParams{
4626+
ID: notifID,
4627+
UserID: u.ID,
4628+
TemplateID: tpl.ID,
4629+
Targets: targets,
4630+
Title: "test title",
4631+
Content: "test content notification",
4632+
Icon: "test icon",
4633+
Actions: json.RawMessage("{}"),
4634+
}).Asserts(rbac.ResourceInboxNotification.WithOwner(o.ID.String()), policy.ActionCreate)
46164635
}))
46174636

46184637
s.Run("SetInboxNotificationAsRead", s.Subtest(func(db database.Store, check *expects) {

0 commit comments

Comments
 (0)