Merge pull request #8320 from tclaus/8319-fix_show_local_posts_link_in_ui

Show local posts in sidebar, if enabled
This commit is contained in:
Benjamin Neff 2021-11-23 01:41:12 +01:00
commit ced6905cbc
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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