Working basic frontend implementation
This commit is contained in:
@@ -16,7 +16,7 @@ defmodule Mixer.Posts.Tweet do
|
||||
end
|
||||
|
||||
state_machine do
|
||||
initial_states [:drafted]
|
||||
initial_states [:drafted, :posted]
|
||||
default_initial_state :drafted
|
||||
|
||||
transitions do
|
||||
@@ -57,4 +57,18 @@ defmodule Mixer.Posts.Tweet do
|
||||
public? true
|
||||
end
|
||||
end
|
||||
|
||||
policies do
|
||||
policy action_type(:read) do
|
||||
authorize_if always()
|
||||
end
|
||||
|
||||
policy action_type(:create) do
|
||||
authorize_if actor_present()
|
||||
end
|
||||
|
||||
policy action_type([:destroy, :update]) do
|
||||
authorize_if relates_to_actor_via(:user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user