radar/twist-v2

View on GitHub
backend/lib/twist/authorization/book.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Twist
  module Authorization
    class Book
      attr_reader :book, :user

      include Import["repositories.permission_repo"]

      def initialize(book:, user:, permission_repo:)
        @book = book
        @user = user
        @permission_repo = permission_repo
      end

      def success?
        permission_repo.user_authorized_for_book?(user, book)
      end
    end
  end
end