Fix accessing group draft post
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
011128b0fb
commit
221dd0609e
@ -91,9 +91,9 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Posts do
|
|||||||
def group_actor(%Post{attributed_to_id: attributed_to_id}),
|
def group_actor(%Post{attributed_to_id: attributed_to_id}),
|
||||||
do: Actors.get_actor(attributed_to_id)
|
do: Actors.get_actor(attributed_to_id)
|
||||||
|
|
||||||
def permissions(%Post{draft: draft}) do
|
def permissions(%Post{}) do
|
||||||
%Permission{
|
%Permission{
|
||||||
access: if(draft, do: nil, else: :member),
|
access: :member,
|
||||||
create: :moderator,
|
create: :moderator,
|
||||||
update: :moderator,
|
update: :moderator,
|
||||||
delete: :moderator
|
delete: :moderator
|
||||||
|
@ -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"]["title"] == post_draft.title
|
||||||
assert res["data"]["post"]["draft"] == true
|
assert res["data"]["post"]["draft"] == true
|
||||||
|
Loading…
Reference in New Issue
Block a user