Skip to content
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

How do I change the default_actions/1 for all schemas at once? #303

Open
ByeongUkChoi opened this issue Nov 11, 2023 · 0 comments
Open

How do I change the default_actions/1 for all schemas at once? #303

ByeongUkChoi opened this issue Nov 11, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ByeongUkChoi
Copy link
Contributor

The default_actions for all schemas is [:new, :edit, :delete]. Is there a way to control default_actions for all schemas without implementing each default_actions/1 function?

For example, I want to prevent all schemas from being added, modified, or deleted. Then I'll have to create an admin module (ex. MyApp.Products.ProductAdmin) for all schemas and override the default_actions/1 function as shown below. Is it possible to set this as a whole in one implementation rather than one?

defmodule MyApp.Products.ProductAdmin do
  def default_actions(_schema) do
    []
  end
end

defmodule MyApp.Products.BlogAdmin do
  def default_actions(_schema) do
    []
  end
end

...
@ByeongUkChoi ByeongUkChoi added the enhancement New feature or request label Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants