-
Notifications
You must be signed in to change notification settings - Fork 17
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
Active Admin - Pundit #378
Conversation
9c7ceeb
to
3a7a0dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
se ve bacán! te dejé una duda pa confirmar, pero fuera de eso, no sé si valdrá la pena hacer un comentario en el readme (de potassium o del proyecto) dado que esto no es tan común o no?
@@ -0,0 +1,2 @@ | |||
class BackOffice::AdminUserPolicy < BackOffice::DefaultPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no sé si tiene sentido, pero deberíamos poner estas policies en una carpeta back_office?
destination_path = [model_namespace, policy_name].compact.join("/") | ||
template( | ||
"../assets/active_admin/policies/#{policy_name}.rb", | ||
"app/policies/back_office/#{destination_path}.rb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah en el proyecto quedan ahí 👌🏻 , retiro lo dicho jaja
copy_policy("default_policy") | ||
copy_policy("admin_user_policy") | ||
copy_policy("page_policy", "active_admin") | ||
copy_policy("comment_policy", "active_admin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
la estructura entonces quedaría por ejemplo:
- app/policies/back_office/default_policy.rb
- app/policies/back_office/admin_user_policy.rb
- app/policies/back_office/active_admin/page_policy.rb
- app/policies/back_office/active_admin/comment_policy.rb
y eventualmente: - app/policies/back_office/my_cool_model_policy.rb
eso o no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
se ve bacán! te dejé una duda pa confirmar, pero fuera de eso, no sé si valdrá la pena hacer un comentario en el readme (de potassium o del proyecto) dado que esto no es tan común o no?
Pensé que la estructura lo hacía más obvio pero quizás no. Voy a agregarle info al README 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
las debajo de active_admin como que me costaba procesarlas
77d22f0
to
76b1a2c
Compare
@@ -153,6 +153,26 @@ readme: | |||
``` | |||
- You can also use **any** vue bindings such as `v-for` , `:key` etc. | |||
<% end %> | |||
<% if get(:authorization) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjherrera le agregué el README
lib/potassium/assets/README.yml
Outdated
`app/policies/back_office/client_policy.rb`: | ||
|
||
```ruby | ||
class BackOffice::CLientPolicy < BackOffice::DefaultPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mini typo CLient
76b1a2c
to
af40294
Compare
Different pundit settings for app and Active Admin.
Active admin policies now go inside the
BackOffice
namespace.Active admin policies now inherit from
BackOffice::DefaultPolicy
.