diff --git a/system/service/application_actions.gen.go b/system/service/application_actions.gen.go index c64659adb..78047f761 100644 --- a/system/service/application_actions.gen.go +++ b/system/service/application_actions.gen.go @@ -498,19 +498,19 @@ func ApplicationErrGeneric(props ...*applicationActionProps) *applicationError { } -// ApplicationErrNonexistent returns "system:application.nonexistent" audit event as actionlog.Warning +// ApplicationErrNotFound returns "system:application.notFound" audit event as actionlog.Warning // // // This function is auto-generated. // -func ApplicationErrNonexistent(props ...*applicationActionProps) *applicationError { +func ApplicationErrNotFound(props ...*applicationActionProps) *applicationError { var e = &applicationError{ timestamp: time.Now(), resource: "system:application", - error: "nonexistent", + error: "notFound", action: "error", - message: "application does not exist", - log: "application does not exist", + message: "application not found", + log: "application not found", severity: actionlog.Warning, props: func() *applicationActionProps { if len(props) > 0 { @@ -569,7 +569,7 @@ func ApplicationErrNotAllowedToRead(props ...*applicationActionProps) *applicati resource: "system:application", error: "notAllowedToRead", action: "error", - message: "not allowed to read application", + message: "not allowed to read this application", log: "failed to read {application.name}; insufficient permissions", severity: actionlog.Error, props: func() *applicationActionProps { @@ -629,7 +629,7 @@ func ApplicationErrNotAllowedToCreate(props ...*applicationActionProps) *applica resource: "system:application", error: "notAllowedToCreate", action: "error", - message: "not allowed to create application", + message: "not allowed to create applications", log: "failed to create application; insufficient permissions", severity: actionlog.Error, props: func() *applicationActionProps { @@ -659,7 +659,7 @@ func ApplicationErrNotAllowedToUpdate(props ...*applicationActionProps) *applica resource: "system:application", error: "notAllowedToUpdate", action: "error", - message: "not allowed to update application", + message: "not allowed to update this application", log: "failed to update {application.name}; insufficient permissions", severity: actionlog.Error, props: func() *applicationActionProps { @@ -689,7 +689,7 @@ func ApplicationErrNotAllowedToDelete(props ...*applicationActionProps) *applica resource: "system:application", error: "notAllowedToDelete", action: "error", - message: "not allowed to delete application", + message: "not allowed to delete this application", log: "failed to delete {application.name}; insufficient permissions", severity: actionlog.Error, props: func() *applicationActionProps { @@ -719,7 +719,7 @@ func ApplicationErrNotAllowedToUndelete(props ...*applicationActionProps) *appli resource: "system:application", error: "notAllowedToUndelete", action: "error", - message: "not allowed to undelete application", + message: "not allowed to undelete this application", log: "failed to undelete {application.name}; insufficient permissions", severity: actionlog.Error, props: func() *applicationActionProps { diff --git a/system/service/application_actions.yaml b/system/service/application_actions.yaml index 1617d695c..9922f8779 100644 --- a/system/service/application_actions.yaml +++ b/system/service/application_actions.yaml @@ -48,8 +48,8 @@ actions: log: "undeleted {application}" errors: - - error: nonexistent - message: "application does not exist" + - error: notFound + message: "application not found" severity: warning - error: invalidID @@ -57,7 +57,7 @@ errors: severity: warning - error: notAllowedToRead - message: "not allowed to read application" + message: "not allowed to read this application" log: "failed to read {application.name}; insufficient permissions" - error: notAllowedToListApplications @@ -65,17 +65,17 @@ errors: log: "failed to list application; insufficient permissions" - error: notAllowedToCreate - message: "not allowed to create application" + message: "not allowed to create applications" log: "failed to create application; insufficient permissions" - error: notAllowedToUpdate - message: "not allowed to update application" + message: "not allowed to update this application" log: "failed to update {application.name}; insufficient permissions" - error: notAllowedToDelete - message: "not allowed to delete application" + message: "not allowed to delete this application" log: "failed to delete {application.name}; insufficient permissions" - error: notAllowedToUndelete - message: "not allowed to undelete application" + message: "not allowed to undelete this application" log: "failed to undelete {application.name}; insufficient permissions" diff --git a/system/service/attachment.go b/system/service/attachment.go index 235469ee0..bf5d62774 100644 --- a/system/service/attachment.go +++ b/system/service/attachment.go @@ -141,7 +141,6 @@ func (svc attachment) Find(filter types.AttachmentFilter) (aa types.AttachmentSe }) return aa, f, svc.recordAction(svc.ctx, aaProps, AttachmentActionSearch, err) - } func (svc attachment) OpenOriginal(att *types.Attachment) (io.ReadSeeker, error) { diff --git a/system/service/attachment_actions.gen.go b/system/service/attachment_actions.gen.go index bf2a4672c..0863050b1 100644 --- a/system/service/attachment_actions.gen.go +++ b/system/service/attachment_actions.gen.go @@ -466,19 +466,19 @@ func AttachmentErrGeneric(props ...*attachmentActionProps) *attachmentError { } -// AttachmentErrNonexistent returns "system:attachment.nonexistent" audit event as actionlog.Warning +// AttachmentErrNotFound returns "system:attachment.notFound" audit event as actionlog.Warning // // // This function is auto-generated. // -func AttachmentErrNonexistent(props ...*attachmentActionProps) *attachmentError { +func AttachmentErrNotFound(props ...*attachmentActionProps) *attachmentError { var e = &attachmentError{ timestamp: time.Now(), resource: "system:attachment", - error: "nonexistent", + error: "notFound", action: "error", - message: "attachment does not exist", - log: "attachment does not exist", + message: "attachment not found", + log: "attachment not found", severity: actionlog.Warning, props: func() *attachmentActionProps { if len(props) > 0 { @@ -567,7 +567,7 @@ func AttachmentErrNotAllowedToCreate(props ...*attachmentActionProps) *attachmen resource: "system:attachment", error: "notAllowedToCreate", action: "error", - message: "not allowed to create attachment", + message: "not allowed to create attachments", log: "failed to create attachment; insufficient permissions", severity: actionlog.Alert, props: func() *attachmentActionProps { diff --git a/system/service/attachment_actions.yaml b/system/service/attachment_actions.yaml index 58f0a1b89..b3330fb6f 100644 --- a/system/service/attachment_actions.yaml +++ b/system/service/attachment_actions.yaml @@ -41,8 +41,8 @@ actions: log: "deleted {attachment}" errors: - - error: nonexistent - message: "attachment does not exist" + - error: notFound + message: "attachment not found" severity: warning - error: invalidID @@ -54,7 +54,7 @@ errors: log: "failed to list attachment; insufficient permissions" - error: notAllowedToCreate - message: "not allowed to create attachment" + message: "not allowed to create attachments" log: "failed to create attachment; insufficient permissions" - error: failedToExtractMimeType diff --git a/system/service/reminder.go b/system/service/reminder.go index 8b981192d..3117ab8f6 100644 --- a/system/service/reminder.go +++ b/system/service/reminder.go @@ -188,7 +188,7 @@ func (svc reminder) Dismiss(ctx context.Context, ID uint64) (err error) { } if r, err = svc.reminder.FindByID(ID); err != nil { - return ReminderErrNonexistent() + return ReminderErrNotFound() } raProps.setReminder(r) @@ -221,7 +221,7 @@ func (svc reminder) Snooze(ctx context.Context, ID uint64, remindAt *time.Time) } if r, err = svc.reminder.FindByID(ID); err != nil { - return ReminderErrNonexistent() + return ReminderErrNotFound() } raProps.setReminder(r) @@ -253,7 +253,7 @@ func (svc reminder) Delete(ctx context.Context, ID uint64) (err error) { } if r, err = svc.FindByID(ctx, ID); err != nil { - return ReminderErrNonexistent() + return ReminderErrNotFound() } raProps.setReminder(r) diff --git a/system/service/reminder_actions.gen.go b/system/service/reminder_actions.gen.go index 5d5a83f0b..06881b08c 100644 --- a/system/service/reminder_actions.gen.go +++ b/system/service/reminder_actions.gen.go @@ -557,19 +557,19 @@ func ReminderErrGeneric(props ...*reminderActionProps) *reminderError { } -// ReminderErrNonexistent returns "system:reminder.nonexistent" audit event as actionlog.Warning +// ReminderErrNotFound returns "system:reminder.notFound" audit event as actionlog.Warning // // // This function is auto-generated. // -func ReminderErrNonexistent(props ...*reminderActionProps) *reminderError { +func ReminderErrNotFound(props ...*reminderActionProps) *reminderError { var e = &reminderError{ timestamp: time.Now(), resource: "system:reminder", - error: "nonexistent", + error: "notFound", action: "error", - message: "reminder does not exist", - log: "reminder does not exist", + message: "reminder not found", + log: "reminder not found", severity: actionlog.Warning, props: func() *reminderActionProps { if len(props) > 0 { diff --git a/system/service/reminder_actions.yaml b/system/service/reminder_actions.yaml index 5dce35f0f..d45f8b327 100644 --- a/system/service/reminder_actions.yaml +++ b/system/service/reminder_actions.yaml @@ -51,8 +51,8 @@ actions: log: "deleted {reminder}" errors: - - error: nonexistent - message: "reminder does not exist" + - error: notFound + message: "reminder not found" severity: warning - error: invalidID diff --git a/system/service/role_actions.gen.go b/system/service/role_actions.gen.go index b34af2b4e..13092e986 100644 --- a/system/service/role_actions.gen.go +++ b/system/service/role_actions.gen.go @@ -741,19 +741,19 @@ func RoleErrGeneric(props ...*roleActionProps) *roleError { } -// RoleErrNonexistent returns "system:role.nonexistent" audit event as actionlog.Warning +// RoleErrNotFOund returns "system:role.notFOund" audit event as actionlog.Warning // // // This function is auto-generated. // -func RoleErrNonexistent(props ...*roleActionProps) *roleError { +func RoleErrNotFOund(props ...*roleActionProps) *roleError { var e = &roleError{ timestamp: time.Now(), resource: "system:role", - error: "nonexistent", + error: "notFOund", action: "error", - message: "role does not exist", - log: "role does not exist", + message: "role not found", + log: "role not found", severity: actionlog.Warning, props: func() *roleActionProps { if len(props) > 0 { @@ -842,7 +842,7 @@ func RoleErrNotAllowedToRead(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToRead", action: "error", - message: "not allowed to read role", + message: "not allowed to read this role", log: "failed to read {role.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { @@ -902,7 +902,7 @@ func RoleErrNotAllowedToCreate(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToCreate", action: "error", - message: "not allowed to create role", + message: "not allowed to create roles", log: "failed to create role; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { @@ -932,7 +932,7 @@ func RoleErrNotAllowedToUpdate(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToUpdate", action: "error", - message: "not allowed to update role", + message: "not allowed to update this role", log: "failed to update {role.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { @@ -962,7 +962,7 @@ func RoleErrNotAllowedToDelete(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToDelete", action: "error", - message: "not allowed to delete role", + message: "not allowed to delete this role", log: "failed to delete {role.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { @@ -992,7 +992,7 @@ func RoleErrNotAllowedToUndelete(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToUndelete", action: "error", - message: "not allowed to undelete role", + message: "not allowed to undelete this role", log: "failed to undelete {role.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { @@ -1022,7 +1022,7 @@ func RoleErrNotAllowedToArchive(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToArchive", action: "error", - message: "not allowed to archive role", + message: "not allowed to archive this role", log: "failed to archive {role.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { @@ -1052,7 +1052,7 @@ func RoleErrNotAllowedToUnarchive(props ...*roleActionProps) *roleError { resource: "system:role", error: "notAllowedToUnarchive", action: "error", - message: "not allowed to unarchive role", + message: "not allowed to unarchive this role", log: "failed to unarchive {role.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *roleActionProps { diff --git a/system/service/role_actions.yaml b/system/service/role_actions.yaml index d1be48009..277f1984b 100644 --- a/system/service/role_actions.yaml +++ b/system/service/role_actions.yaml @@ -76,8 +76,8 @@ actions: errors: - - error: nonexistent - message: "role does not exist" + - error: notFOund + message: "role not found" severity: warning - error: invalidID @@ -89,7 +89,7 @@ errors: severity: warning - error: notAllowedToRead - message: "not allowed to read role" + message: "not allowed to read this role" log: "failed to read {role.handle}; insufficient permissions" - error: notAllowedToListRoles @@ -97,27 +97,27 @@ errors: log: "failed to list role; insufficient permissions" - error: notAllowedToCreate - message: "not allowed to create role" + message: "not allowed to create roles" log: "failed to create role; insufficient permissions" - error: notAllowedToUpdate - message: "not allowed to update role" + message: "not allowed to update this role" log: "failed to update {role.handle}; insufficient permissions" - error: notAllowedToDelete - message: "not allowed to delete role" + message: "not allowed to delete this role" log: "failed to delete {role.handle}; insufficient permissions" - error: notAllowedToUndelete - message: "not allowed to undelete role" + message: "not allowed to undelete this role" log: "failed to undelete {role.handle}; insufficient permissions" - error: notAllowedToArchive - message: "not allowed to archive role" + message: "not allowed to archive this role" log: "failed to archive {role.handle}; insufficient permissions" - error: notAllowedToUnarchive - message: "not allowed to unarchive role" + message: "not allowed to unarchive this role" log: "failed to unarchive {role.handle}; insufficient permissions" - error: notAllowedToManageMembers diff --git a/system/service/user.go b/system/service/user.go index fa595c90e..8dd14adbc 100644 --- a/system/service/user.go +++ b/system/service/user.go @@ -239,7 +239,7 @@ func (svc user) FindByAny(identifier interface{}) (u *types.User, err error) { func (svc user) proc(u *types.User, err error) (*types.User, error) { if err != nil { if repository.ErrUserNotFound.Eq(err) { - return nil, UserErrNonexistent() + return nil, UserErrNotFound() } return nil, err diff --git a/system/service/user_actions.gen.go b/system/service/user_actions.gen.go index 12e01f486..008ba7c99 100644 --- a/system/service/user_actions.gen.go +++ b/system/service/user_actions.gen.go @@ -639,19 +639,19 @@ func UserErrGeneric(props ...*userActionProps) *userError { } -// UserErrNonexistent returns "system:user.nonexistent" audit event as actionlog.Warning +// UserErrNotFound returns "system:user.notFound" audit event as actionlog.Warning // // // This function is auto-generated. // -func UserErrNonexistent(props ...*userActionProps) *userError { +func UserErrNotFound(props ...*userActionProps) *userError { var e = &userError{ timestamp: time.Now(), resource: "system:user", - error: "nonexistent", + error: "notFound", action: "error", - message: "user does not exist", - log: "user does not exist", + message: "user not found", + log: "user not found", severity: actionlog.Warning, props: func() *userActionProps { if len(props) > 0 { @@ -770,7 +770,7 @@ func UserErrNotAllowedToRead(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToRead", action: "error", - message: "not allowed to read user", + message: "not allowed to read this user", log: "failed to read {user.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { @@ -830,8 +830,8 @@ func UserErrNotAllowedToCreate(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToCreate", action: "error", - message: "not allowed to create user", - log: "failed to create user; insufficient permissions", + message: "not allowed to create users", + log: "failed to create users; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { if len(props) > 0 { @@ -860,7 +860,7 @@ func UserErrNotAllowedToUpdate(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToUpdate", action: "error", - message: "not allowed to update user", + message: "not allowed to update this user", log: "failed to update {user.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { @@ -890,7 +890,7 @@ func UserErrNotAllowedToDelete(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToDelete", action: "error", - message: "not allowed to delete user", + message: "not allowed to delete this user", log: "failed to delete {user.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { @@ -920,7 +920,7 @@ func UserErrNotAllowedToUndelete(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToUndelete", action: "error", - message: "not allowed to undelete user", + message: "not allowed to undelete this user", log: "failed to undelete {user.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { @@ -950,7 +950,7 @@ func UserErrNotAllowedToSuspend(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToSuspend", action: "error", - message: "not allowed to suspend user", + message: "not allowed to suspend this user", log: "failed to suspend {user.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { @@ -980,7 +980,7 @@ func UserErrNotAllowedToUnsuspend(props ...*userActionProps) *userError { resource: "system:user", error: "notAllowedToUnsuspend", action: "error", - message: "not allowed to unsuspend user", + message: "not allowed to unsuspend this user", log: "failed to unsuspend {user.handle}; insufficient permissions", severity: actionlog.Alert, props: func() *userActionProps { diff --git a/system/service/user_actions.yaml b/system/service/user_actions.yaml index 39ccb3687..ab9b02e72 100644 --- a/system/service/user_actions.yaml +++ b/system/service/user_actions.yaml @@ -60,8 +60,8 @@ actions: log: "password changed for {user}" errors: - - error: nonexistent - message: "user does not exist" + - error: notFound + message: "user not found" severity: warning - error: invalidID @@ -78,7 +78,7 @@ errors: - error: notAllowedToRead - message: "not allowed to read user" + message: "not allowed to read this user" log: "failed to read {user.handle}; insufficient permissions" - error: notAllowedToListUsers @@ -86,27 +86,27 @@ errors: log: "failed to list user; insufficient permissions" - error: notAllowedToCreate - message: "not allowed to create user" - log: "failed to create user; insufficient permissions" + message: "not allowed to create users" + log: "failed to create users; insufficient permissions" - error: notAllowedToUpdate - message: "not allowed to update user" + message: "not allowed to update this user" log: "failed to update {user.handle}; insufficient permissions" - error: notAllowedToDelete - message: "not allowed to delete user" + message: "not allowed to delete this user" log: "failed to delete {user.handle}; insufficient permissions" - error: notAllowedToUndelete - message: "not allowed to undelete user" + message: "not allowed to undelete this user" log: "failed to undelete {user.handle}; insufficient permissions" - error: notAllowedToSuspend - message: "not allowed to suspend user" + message: "not allowed to suspend this user" log: "failed to suspend {user.handle}; insufficient permissions" - error: notAllowedToUnsuspend - message: "not allowed to unsuspend user" + message: "not allowed to unsuspend this user" log: "failed to unsuspend {user.handle}; insufficient permissions" - error: handleNotUnique diff --git a/tests/system/application_test.go b/tests/system/application_test.go index c17712de9..585f35fc3 100644 --- a/tests/system/application_test.go +++ b/tests/system/application_test.go @@ -80,7 +80,7 @@ func TestApplicationCreateForbidden(t *testing.T) { FormData("name", "my-app"). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to create application")). + Assert(helpers.AssertError("not allowed to create applications")). End() } @@ -106,7 +106,7 @@ func TestApplicationUpdateForbidden(t *testing.T) { FormData("name", "changed-name"). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to update application")). + Assert(helpers.AssertError("not allowed to update this application")). End() } @@ -137,7 +137,7 @@ func TestApplicationDeleteForbidden(t *testing.T) { Delete(fmt.Sprintf("/application/%d", a.ID)). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to delete application")). + Assert(helpers.AssertError("not allowed to delete this application")). End() } diff --git a/tests/system/organisation_test.go b/tests/system/organisation_test.go index 7811535a7..04ac83f96 100644 --- a/tests/system/organisation_test.go +++ b/tests/system/organisation_test.go @@ -99,7 +99,7 @@ func TestOrganisationUpdateForbidden(t *testing.T) { FormData("name", "changed-name"). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("Not allowed to update organisation")). + Assert(helpers.AssertError("Not allowed to update this organisation")). End() } @@ -134,7 +134,7 @@ func TestOrganisationDeleteForbidden(t *testing.T) { Delete(fmt.Sprintf("/organisation/%d", a.ID)). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("Not allowed to delete organisation")). + Assert(helpers.AssertError("Not allowed to delete this organisation")). End() } diff --git a/tests/system/role_test.go b/tests/system/role_test.go index bb73e54a8..c624971de 100644 --- a/tests/system/role_test.go +++ b/tests/system/role_test.go @@ -98,7 +98,7 @@ func TestRoleCreateForbidden(t *testing.T) { FormData("name", rs()). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to create role")). + Assert(helpers.AssertError("not allowed to create roles")). End() } @@ -150,7 +150,7 @@ func TestRoleUpdateForbidden(t *testing.T) { FormData("email", h.randEmail()). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to update role")). + Assert(helpers.AssertError("not allowed to update this role")). End() } @@ -186,7 +186,7 @@ func TestRoleDeleteForbidden(t *testing.T) { Delete(fmt.Sprintf("/roles/%d", u.ID)). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to delete role")). + Assert(helpers.AssertError("not allowed to delete this role")). End() } diff --git a/tests/system/user_test.go b/tests/system/user_test.go index 66f056084..20d903a90 100644 --- a/tests/system/user_test.go +++ b/tests/system/user_test.go @@ -245,7 +245,7 @@ func TestUserCreateForbidden(t *testing.T) { FormData("email", h.randEmail()). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to create user")). + Assert(helpers.AssertError("not allowed to create users")). End() } @@ -278,7 +278,7 @@ func TestUserUpdateForbidden(t *testing.T) { FormData("email", h.randEmail()). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to update user")). + Assert(helpers.AssertError("not allowed to update this user")). End() } @@ -311,7 +311,7 @@ func TestUserDeleteForbidden(t *testing.T) { Delete(fmt.Sprintf("/users/%d", u.ID)). Expect(t). Status(http.StatusOK). - Assert(helpers.AssertError("not allowed to delete user")). + Assert(helpers.AssertError("not allowed to delete this user")). End() }