tryzealot/zealot

View on GitHub
app/helpers/collaborators_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module CollaboratorsHelper
  def same_user?(collaborator)
    collaborator.user == current_user
  end

  def edit_role_user?(collaborator)
    target_role = collaborator.role
    return true if current_user.admin?
    return true if current_user.app_roles?(collaborator.app, :admin)

    false
  end
end