Fix accessing group draft post

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-07-28 10:35:39 +02:00
parent 011128b0fb
commit 221dd0609e
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 3 additions and 3 deletions

View File

@ -91,9 +91,9 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Posts do
def group_actor(%Post{attributed_to_id: attributed_to_id}),
do: Actors.get_actor(attributed_to_id)
def permissions(%Post{draft: draft}) do
def permissions(%Post{}) do
%Permission{
access: if(draft, do: nil, else: :member),
access: :member,
create: :moderator,
update: :moderator,
delete: :moderator

View File

@ -297,7 +297,7 @@ defmodule Mobilizon.GraphQL.Resolvers.PostTest do
}
)
assert is_nil(res["errors"])
assert res["errors"] == nil
assert res["data"]["post"]["title"] == post_draft.title
assert res["data"]["post"]["draft"] == true