Skip to content

Commit

Permalink
Merge pull request #2565 from manyfold3d/enable-single-user-instance-…
Browse files Browse the repository at this point in the history
…federation

Allow federation on single-user instances
  • Loading branch information
Floppy committed Aug 22, 2024
2 parents c45837c + be25f94 commit a6df70b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/follow_button_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def before_render
end

def render?
SiteSettings.multiuser_enabled?
SiteSettings.multiuser_enabled? || SiteSettings.federation_enabled?
end

erb_template <<-ERB
Expand Down
10 changes: 6 additions & 4 deletions app/policies/federails/following_policy.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
class Federails::FollowingPolicy < ApplicationPolicy
def create?
all_of(
SiteSettings.multiuser_enabled?
any_of(
SiteSettings.multiuser_enabled?,
SiteSettings.federation_enabled?
)
end

def destroy?
all_of(
SiteSettings.multiuser_enabled?
any_of(
SiteSettings.multiuser_enabled?,
SiteSettings.federation_enabled?
)
end

Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
resources :activity
end

mount Federails::Engine => "/" if SiteSettings.multiuser_enabled? || Rails.env.test?
mount Federails::Engine => "/" if SiteSettings.multiuser_enabled? || SiteSettings.federation_enabled? || Rails.env.test?

resources :users, only: [] do
resource :settings, only: [:show, :update]
Expand Down

0 comments on commit a6df70b

Please sign in to comment.