diff --git a/apps/simplex-directory-service/src/Directory/Service.hs b/apps/simplex-directory-service/src/Directory/Service.hs index ea79dabb10..c1428881b9 100644 --- a/apps/simplex-directory-service/src/Directory/Service.hs +++ b/apps/simplex-directory-service/src/Directory/Service.hs @@ -177,8 +177,8 @@ directoryService st DirectoryOpts {superUsers, serviceName, searchResults, testi badRolesMsg :: GroupRolesStatus -> Maybe String badRolesMsg = \case GRSOk -> Nothing - GRSServiceNotAdmin -> Just "You must have a group *owner* role to register the group" - GRSContactNotOwner -> Just "You must grant directory service *admin* role to register the group" + GRSServiceNotAdmin -> Just "You must grant directory service *admin* role to register the group" + GRSContactNotOwner -> Just "You must have a group *owner* role to register the group" GRSBadRoles -> Just "You must have a group *owner* role and you must grant directory service *admin* role to register the group" getGroupRolesStatus :: GroupInfo -> GroupReg -> IO (Maybe GroupRolesStatus) @@ -190,8 +190,8 @@ directoryService st DirectoryOpts {superUsers, serviceName, searchResults, testi groupRolesStatus :: GroupMemberRole -> GroupMemberRole -> GroupRolesStatus groupRolesStatus contactRole serviceRole = case (contactRole, serviceRole) of (GROwner, GRAdmin) -> GRSOk - (_, GRAdmin) -> GRSServiceNotAdmin - (GROwner, _) -> GRSContactNotOwner + (_, GRAdmin) -> GRSContactNotOwner + (GROwner, _) -> GRSServiceNotAdmin _ -> GRSBadRoles getGroupMember :: GroupReg -> IO (Maybe GroupMember) diff --git a/tests/Bots/DirectoryTests.hs b/tests/Bots/DirectoryTests.hs index 1054a1d8eb..b78d36f489 100644 --- a/tests/Bots/DirectoryTests.hs +++ b/tests/Bots/DirectoryTests.hs @@ -522,7 +522,7 @@ testNotApprovedBadRoles tmp = let approve = "/approve 1:privacy 1" superUser #> ("@SimpleX-Directory " <> approve) superUser <# ("SimpleX-Directory> > " <> approve) - superUser <## " Group is not approved: user is not an owner." + superUser <## " Group is not approved: SimpleX-Directory is not an admin." groupNotFound cath "privacy" bob ##> "/mr privacy SimpleX-Directory admin" bob <## "#privacy: you changed the role of SimpleX-Directory from member to admin"