-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Allow association policy over base policy #2653
Comments
@Paul-Bob - i just noticed that the workaround is not really solving my issue. to give some context why this is so important i will try to outline an example: i have a now if you want to participate in a Competition you are only allowed to participate in some of the disciplines that were selected in the corresponsing so what i do is on my field :disciplines,
as: :tags,
delimiters: [","],
suggestions: -> { record.competition.disciplines },
enforce_suggestions: true,
filterable: true but now there comes the issue - when i try to create a new so what i want to do is to hide the create-button on the index-view of the when using the workaround: self.index_controls = -> do
actions_list exclude: [:create_button]
end it hides the create-button in both resources (and i cannot create a |
also for some reason, for: # avo/resources/competition_participation.rb
self.index_controls = -> do
if record.competition.present?
create_button label: "I know the Competition"
else
actions_list exclude: [:create_button]
end
end it seems as if it takes the first record from the list and the then when clicking create, it throws an exception since inside the field |
@Bergrebell self.index_controls = -> do
actions_list exclude: [:create_button]
end Above code will render the action list excluding some action called This is what you need in order to satisfy the requirements: self.index_controls = -> do
actions_list
attach_button label: "Attach ..."
# might exists better ways to check if we're on a association index, this is just an example for a workaround
create_button label: "Create..." if params[:controller] == "avo/associations"
end |
okay, that works for now! thanks for the hint with checking the params! 👍 but its still strange that |
Yes resource is hydrated with the last item of the table to avoid some breaking changes, we're working in it on this PR https://github.com/avo-hq/avo/pull/2549/files#diff-d8698d47659420f473312cd3cca742b38aec454280864548bdcbd9b2a49379cd |
Context
We should be able to block creation on User policy but allow users creation from the team policy.
From here https://discord.com/channels/740892036978442260/1224645956155342859
As a workaround on advanced licenses the create button can be hidden using the custom controls https://docs.avohq.io/3.0/customizable-controls.html#index_page
The text was updated successfully, but these errors were encountered: