diff --git a/Changelog.md b/Changelog.md index a7088553c..41e846189 100644 --- a/Changelog.md +++ b/Changelog.md @@ -34,7 +34,7 @@ Although the chat was never enabled per default and was marked as experimental, * Add client-site rescaling of post images if they exceed the maximum possible size [#7734](https://github.com/diaspora/diaspora/pull/7734) * Add backend for archive import [#7660](https://github.com/diaspora/diaspora/pull/7660) [#8254](https://github.com/diaspora/diaspora/pull/8254) [#8264](https://github.com/diaspora/diaspora/pull/8264) [#8010](https://github.com/diaspora/diaspora/pull/8010) [#8260](https://github.com/diaspora/diaspora/pull/8260) [#8302](https://github.com/diaspora/diaspora/pull/8302) * For pods running PostgreSQL, make sure that no upper-case/mixed-case tags exist, and create a `lower(name)` index on tags to speed up ActsAsTaggableOn [#8206](https://github.com/diaspora/diaspora/pull/8206) -* Allow podmins/moderators to see all local public posts to improve moderation [#8232](https://github.com/diaspora/diaspora/pull/8232) +* Allow podmins/moderators to see all local public posts to improve moderation [#8232](https://github.com/diaspora/diaspora/pull/8232) [#8320](https://github.com/diaspora/diaspora/pull/8320) * Add support for directly paste images to upload them [#8237](https://github.com/diaspora/diaspora/pull/8237) # 0.7.16.0 diff --git a/lib/configuration_methods.rb b/lib/configuration_methods.rb index 22a5e1a16..bdd6642df 100644 --- a/lib/configuration_methods.rb +++ b/lib/configuration_methods.rb @@ -52,9 +52,9 @@ module Configuration def local_posts_stream?(user) return true if settings.enable_local_posts_stream == "admins" && - Role.is_admin?(user) + user.admin? return true if settings.enable_local_posts_stream == "moderators" && - (Role.moderator?(user) || Role.is_admin?(user)) + user.moderator? settings.enable_local_posts_stream == "everyone" end diff --git a/spec/lib/configuration_methods_spec.rb b/spec/lib/configuration_methods_spec.rb index 2453d406f..037559399 100644 --- a/spec/lib/configuration_methods_spec.rb +++ b/spec/lib/configuration_methods_spec.rb @@ -129,11 +129,11 @@ describe Configuration::Methods do end describe "#has_local_posts_stream" do - let!(:moderator) { create(:person) } - let!(:admin) { create(:person) } + let!(:moderator) { create(:user) } + let!(:admin) { create(:user) } before do - moderator.roles.create(name: "moderator") - admin.roles.create(name: "admin") + Role.add_moderator(moderator.person) + Role.add_admin(admin.person) end it "return false if show_local_posts_link is 'disabled'" do