-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support LiveView #23
Comments
I guess what we need here is a way to distinguish between multiple types of requests. We only considered regular REST requests, but there's also websockets (which LiveView is a subset of), and also graphql There's two decision there, I think.
(just pseudo-code, not sure if that syntax would even work) Or you can just ignore all that, and somehow try to guess the action & resource for every single type of request. Which, at least at face value, I don't particularly like, for 2 reasons:
The second decision is how to ask for permissions to each of them. Here I think we can even allow both options, because of pattern matching:
|
You make a very good point.
I agree with your reasons, I don't think that is the correct way to approach it.
I like this idea, but I'm getting concerned with so many configuration options. It's becoming too verbose IMO. How about
I don't like that pattern visually. It's starting to get too verbose. We know that for REST requests, we can use the action to pattern match. For live view, I think at most we have the path, so we can go with that: defmodule MyPolicy do
def can?(:show, _, _), do: true
def can?("live/path", _, _), do: true
end Ideally we would suggest a policy explicit for LiveView, so that these wouldn't mix up but that doesn't look too bad does it? I don't know how it would work for GraphQL |
I like this approach. assuming it's feasible. I can't picture right away how this would work One question though. Would it be |
I think LiveView adds a few |
We're currently not supporting any type of authorisation for LiveView.
Should we add a plug that makes use of
conn.private[:phoenix_live_view]
and calls certain policies?What about inferring the action and resource? How could that be achieved?
Should we add a new
Dictator.Policies.LiveView
module since it will essentially be a different type of policy?The text was updated successfully, but these errors were encountered: