Skip to content

Commit

Permalink
Update connected members page to rely on RemoteIdentities
Browse files Browse the repository at this point in the history
  • Loading branch information
mereghost committed Aug 8, 2024
1 parent 42cf223 commit d71efd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
Expand Down Expand Up @@ -104,7 +106,7 @@ def storage_connection_status

def oauth_client_connected?
storage.oauth_client.present? &&
member.oauth_client_tokens.any? { |token| token.oauth_client_id == storage.oauth_client.id }
member.principal.remote_identities.exists?(oauth_client: storage.oauth_client)
end

def can_read_files?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
Expand Down Expand Up @@ -40,9 +42,9 @@ class Storages::ProjectSettings::ProjectStorageMembersController < Projects::Set

def index
@memberships = Member
.of_project(@project)
.includes(:principal, :oauth_client_tokens, roles: :role_permissions)
.paginate(page: page_param, per_page: per_page_param)
.of_project(@project)
.includes(principal: :remote_identities, roles: :role_permissions)
.paginate(page: page_param, per_page: per_page_param)

render "/storages/project_settings/project_storage_members/index"
end
Expand Down

0 comments on commit d71efd7

Please sign in to comment.