Added users page and user viewing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
defmodule Mixer.Accounts do
|
||||
use Ash.Domain, otp_app: :mixer, extensions: [AshAdmin.Domain]
|
||||
use Ash.Domain, otp_app: :mixer, extensions: [AshTypescript.Rpc, AshAdmin.Domain]
|
||||
|
||||
admin do
|
||||
show? true
|
||||
@@ -10,4 +10,10 @@ defmodule Mixer.Accounts do
|
||||
resource Mixer.Accounts.User
|
||||
resource Mixer.Accounts.ApiKey
|
||||
end
|
||||
|
||||
typescript_rpc do
|
||||
resource Mixer.Accounts.User do
|
||||
rpc_action :read_user, :read
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ defmodule Mixer.Accounts.User do
|
||||
domain: Mixer.Accounts,
|
||||
data_layer: AshPostgres.DataLayer,
|
||||
authorizers: [Ash.Policy.Authorizer],
|
||||
extensions: [AshAuthentication]
|
||||
extensions: [AshAuthentication, AshTypescript.Resource]
|
||||
|
||||
authentication do
|
||||
add_ons do
|
||||
@@ -66,6 +66,10 @@ defmodule Mixer.Accounts.User do
|
||||
repo Mixer.Repo
|
||||
end
|
||||
|
||||
typescript do
|
||||
type_name "users"
|
||||
end
|
||||
|
||||
actions do
|
||||
defaults [:read]
|
||||
|
||||
@@ -282,6 +286,10 @@ defmodule Mixer.Accounts.User do
|
||||
bypass AshAuthentication.Checks.AshAuthenticationInteraction do
|
||||
authorize_if always()
|
||||
end
|
||||
|
||||
policy action_type(:read) do
|
||||
authorize_if always()
|
||||
end
|
||||
end
|
||||
|
||||
attributes do
|
||||
|
||||
Reference in New Issue
Block a user