[Git][noosfero/noosfero][master] 2 commits: [PublicAccessRestriction] Fixes news block check
Rodrigo Souto
gitlab at mg.gitlab.com
Mon Jul 23 13:11:52 BRT 2018
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
efa401fa by Gabriel Silva at 2018-07-20T17:33:00Z
[PublicAccessRestriction] Fixes news block check
Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>
- - - - -
f417e1a5 by Rodrigo Souto at 2018-07-23T16:11:47Z
Merge branch 'public-restriction-fix' into 'master'
[PublicAccessRestriction] Fixes news block check
See merge request noosfero/noosfero!1573
- - - - -
2 changed files:
- plugins/public_access_restriction/lib/public_access_restriction_plugin.rb
- plugins/public_access_restriction/test/unit/public_access_restriction_test.rb
Changes:
=====================================
plugins/public_access_restriction/lib/public_access_restriction_plugin.rb
=====================================
@@ -60,7 +60,7 @@ class PublicAccessRestrictionPlugin < Noosfero::Plugin
def linked_on_portal_news(environment, params, profile)
return false unless params['controller'] == 'content_viewer' && params['action'] == 'view_page'
return false if params['page'].nil?
- article = profile.articles.find_by(path: params['page'].join('/'))
+ article = profile.articles.find_by(path: params['page'])
portal = environment.portal_community
portal.articles.
where(type: 'LinkArticle').
=====================================
plugins/public_access_restriction/test/unit/public_access_restriction_test.rb
=====================================
@@ -80,7 +80,9 @@ class PublicAccessRestrictionPluginTest < ActiveSupport::TestCase
task = ApproveArticle.create!(article: article, name: article.name, target: portal, requestor: fast_create(Person), create_link: true)
task.finish
- refute @plugin.should_block?(user, @env, article.url, community)
+ params = article.url
+ params[:page] = params[:page].join('/')
+ refute @plugin.should_block?(user, @env, params, community)
end
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ed70c2041416aa36ade4229c3075e57c099f3192...f417e1a562788eb43b8dd478bb664767ac1326d0
--
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ed70c2041416aa36ade4229c3075e57c099f3192...f417e1a562788eb43b8dd478bb664767ac1326d0
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180723/a4f4a555/attachment-0001.html>
More information about the Noosfero-dev
mailing list