Skip to content

Commit

Permalink
Merge pull request #399 from nyaruka/remove_viewers
Browse files Browse the repository at this point in the history
Remove viewer users
  • Loading branch information
rowanseymour authored Jan 9, 2025
2 parents 5049025 + 39d3fb8 commit ca57be2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions core/models/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ type UserRole string
const (
UserRoleAdministrator UserRole = "A"
UserRoleEditor UserRole = "E"
UserRoleViewer UserRole = "V"
UserRoleAgent UserRole = "T"
UserRoleSurveyor UserRole = "S"
)

// User is our type for a user asset
Expand Down
1 change: 0 additions & 1 deletion core/models/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func TestLoadUsers(t *testing.T) {
{id: testdata.Admin.ID, email: testdata.Admin.Email, name: "Andy Admin", role: models.UserRoleAdministrator, team: nil},
{id: testdata.Agent.ID, email: testdata.Agent.Email, name: "Ann D'Agent", role: models.UserRoleAgent, team: partners},
{id: testdata.Editor.ID, email: testdata.Editor.Email, name: "Ed McEditor", role: models.UserRoleEditor, team: nil},
{id: testdata.Viewer.ID, email: testdata.Viewer.Email, name: "Veronica Views", role: models.UserRoleViewer, team: nil},
}

require.Equal(t, len(expectedUsers), len(users))
Expand Down
3 changes: 1 addition & 2 deletions testsuite/testdata/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ var AuthGroupIDs = map[string]int{
var Org1 = &Org{1, "bf0514a5-9407-44c9-b0f9-3f36f9c18414"}
var Admin = &User{3, "admin1@textit.com"}
var Editor = &User{4, "editor1@textit.com"}
var Viewer = &User{5, "viewer1@textit.com"}
var Agent = &User{6, "agent1@textit.com"}
var Agent = &User{5, "agent1@textit.com"}

var TwilioChannel = &Channel{10000, "74729f45-7f29-4868-9dc4-90e491e3c7d8", "T"}
var VonageChannel = &Channel{10001, "19012bfd-3ce3-4cae-9bb9-76cf92c73d49", "NX"}
Expand Down
Binary file modified testsuite/testfiles/postgres.dump
Binary file not shown.
4 changes: 2 additions & 2 deletions web/msg/testdata/send.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"path": "/mr/msg/send",
"body": {
"org_id": 1,
"user_id": 6,
"user_id": 5,
"contact_id": 10000,
"text": "we can help",
"ticket_id": $cathy_ticket_id$
Expand Down Expand Up @@ -147,7 +147,7 @@
"count": 1
},
{
"query": "SELECT SUM(count) FROM tickets_ticketdailycount WHERE count_type = 'R' AND scope = 'o:1:u:6'",
"query": "SELECT SUM(count) FROM tickets_ticketdailycount WHERE count_type = 'R' AND scope = 'o:1:u:5'",
"count": 1
},
{
Expand Down
4 changes: 2 additions & 2 deletions web/ticket/testdata/assign.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
2,
3
],
"assignee_id": 6
"assignee_id": 5
},
"status": 200,
"response": {
Expand All @@ -22,7 +22,7 @@
},
"db_assertions": [
{
"query": "SELECT count(*) FROM tickets_ticket WHERE assignee_id = 6",
"query": "SELECT count(*) FROM tickets_ticket WHERE assignee_id = 5",
"count": 3
},
{
Expand Down

0 comments on commit ca57be2

Please sign in to comment.