-
Notifications
You must be signed in to change notification settings - Fork 49
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
DEV: Scope guardian methods to the plugin and some cleanup #138
Conversation
5074274
to
2322249
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.
Approving but just asking a few clarifying questions
) | ||
return false | ||
end | ||
add_to_serializer :post, :can_translate do |
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.
You might want to add a include_condition
here too to just check SiteSetting.translator_enabled
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.
From /t/92657 if we don't include define_include_method=false
we won't need to check if the plugin is enabled since by default respect_plugin_enabled
is true
.
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.
Ahhh okay cool, good to know 👍
dd8f0f3
to
7e89003
Compare
Thank you @martin-brennan |
While making some updates to the translator plugin, I found some generic guardian additions which could potentially cause conflicts. e.g.
guardian.user_group_allowed?
->guardian.user_group_allow_translate?
.This PR
SiteSetting.group_map
functions anduser.in_any_groups
functionsadd_to_serializer