repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/event_import_file_job.rb
app/jobs/event_import_file_job.rb
class EventImportFileJob < ApplicationJob queue_as :enju_leaf def perform(event_import_file) event_import_file.import_start end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/user_import_file_job.rb
app/jobs/user_import_file_job.rb
class UserImportFileJob < ApplicationJob queue_as :enju_leaf def perform(user_import_file) user_import_file.import_start end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/manifestation_reserve_stat_job.rb
app/jobs/manifestation_reserve_stat_job.rb
class ManifestationReserveStatJob < ApplicationJob queue_as :enju_leaf def perform(manifestation_reserve_stat) manifestation_reserve_stat.transition_to!(:started) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/application_job.rb
app/jobs/application_job.rb
class ApplicationJob < ActiveJob::Base end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/resource_export_file_job.rb
app/jobs/resource_export_file_job.rb
class ResourceExportFileJob < ApplicationJob queue_as :enju_leaf def perform(resource_export_file) resource_export_file.export! end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/user_reserve_stat_job.rb
app/jobs/user_reserve_stat_job.rb
class UserReserveStatJob < ApplicationJob queue_as :enju_leaf def perform(user_reserve_stat) user_reserve_stat.transition_to!(:started) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/user_checkout_stat_job.rb
app/jobs/user_checkout_stat_job.rb
class UserCheckoutStatJob < ApplicationJob queue_as :enju_leaf def perform(user_checkout_stat) user_checkout_stat.transition_to!(:started) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/manifestation_checkout_stat_job.rb
app/jobs/manifestation_checkout_stat_job.rb
class ManifestationCheckoutStatJob < ApplicationJob queue_as :enju_leaf def perform(manifestation_checkout_stat) manifestation_checkout_stat.transition_to!(:started) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/event_export_file_job.rb
app/jobs/event_export_file_job.rb
class EventExportFileJob < ApplicationJob queue_as :enju_leaf def perform(event_export_file) event_export_file.export! end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/jobs/agent_import_file_job.rb
app/jobs/agent_import_file_job.rb
class AgentImportFileJob < ApplicationJob queue_as :enju_leaf def perform(agent_import_file) agent_import_file.import_start end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/shelves_helper.rb
app/helpers/shelves_helper.rb
module ShelvesHelper def library_shelf_facet(current_library, facet) library = Library.where(name: facet.value).select([ :name, :display_name ]).first return nil unless library current = true if current_library.try(:name) == library.name content_tag :li do if current content_tag :strong...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/series_statements_helper.rb
app/helpers/series_statements_helper.rb
module SeriesStatementsHelper include ManifestationsHelper def series_pagination_link if flash[:manifestation_id] render "manifestations/paginate_id_link", manifestation: Manifestation.find(flash[:manifestation_id]) end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/libraries_helper.rb
app/helpers/libraries_helper.rb
module LibrariesHelper def filtered_params params.permit([ :q, :query, :view, :format, :order, :sort_by, :page, :per_page ]) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/items_helper.rb
app/helpers/items_helper.rb
module ItemsHelper def circulation_status_facet(facet) circulation_status = CirculationStatus.where(name: facet.value).select([ :name, :display_name ]).first if circulation_status # string << form_icon(circulation_status) current = true if params[:circulation_status] == circulation_status.name ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/picture_files_helper.rb
app/helpers/picture_files_helper.rb
module PictureFilesHelper def show_image(picture_file, options = { size: :medium }) return unless picture_file.attachment.attached? case options[:size] when :medium image_tag picture_file.attachment.variant(resize_to_limit: [ 600, nil ]), alt: "*", width: 600 when :thumb image_tag picture...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/loc_search_helper.rb
app/helpers/loc_search_helper.rb
module LocSearchHelper def link_to_import_from_loc(lccn) if lccn.blank? t("enju_loc.not_available") else manifestation = LccnRecord.find_by(body: lccn)&.manifestation unless manifestation button_to t("enju_loc.add"), loc_search_index_path(book: { lccn: lccn }), method: :post, data: {...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/checkouts_helper.rb
app/helpers/checkouts_helper.rb
module CheckoutsHelper def filtered_params params.permit([ :user_id, :days_overdue, :reserved ]) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/reserves_helper.rb
app/helpers/reserves_helper.rb
module ReservesHelper include ManifestationsHelper rescue nil def i18n_state(state) case state when "pending" t("reserve.pending") when "requested" t("reserve.requested") when "retained" t("reserve.retained") when "canceled" t("reserve.canceled") when "expired" ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/ndl_books_helper.rb
app/helpers/ndl_books_helper.rb
module NdlBooksHelper def link_to_import_from_ndl(iss_itemno) if iss_itemno.blank? t("enju_ndl.not_available") else ndl_bib_id_record = NdlBibIdRecord.find_by(body: iss_itemno) if ndl_bib_id_record link_to t("enju_ndl.already_exists"), ndl_bib_id_record.manifestation else ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/owns_helper.rb
app/helpers/owns_helper.rb
module OwnsHelper include ManifestationsHelper end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/order_list_helper.rb
app/helpers/order_list_helper.rb
module OrderListHelper def localized_order_state(current_state) case current_state when "pending" t("state.pending") when "not_ordered" t("order_list.not_ordered") when "ordered" t("order_list.ordered") end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/messages_helper.rb
app/helpers/messages_helper.rb
module MessagesHelper def filtered_params params.permit([ :view, :format, :page, :mode, :sort_by, :per_page ]) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/cinii_books_helper.rb
app/helpers/cinii_books_helper.rb
module CiniiBooksHelper def link_to_import_from_cinii(ncid) if ncid.blank? t("enju_nii.not_available") else ncid_record = NcidRecord.find_by(body: "ncid") if ncid_record link_to t("enju_nii.already_exists"), ncid_record.manifestation else button_to t("enju_nii.add"), ci...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/application_helper.rb
app/helpers/application_helper.rb
module ApplicationHelper end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/events_helper.rb
app/helpers/events_helper.rb
module EventsHelper def filtered_params params.permit([ :format, :library_id, :mode, :query, :page, :per_page ]) end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/manifestations_helper.rb
app/helpers/manifestations_helper.rb
module ManifestationsHelper # include EnjuCirculation::ManifestationsHelper if defined?(EnjuCirculation) def resource_title(manifestation, action) string = LibraryGroup.site_config.display_name.localize.dup unless action == ("index" or "new") if manifestation.try(:original_title) string << " ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/agents_helper.rb
app/helpers/agents_helper.rb
module AgentsHelper include PictureFilesHelper def agent_custom_book_jacket(agent) link = "" agent.picture_files.each_with_index do |picture_file, i| if i == 0 link += link_to(show_image(picture_file, size: :thumb), rails_blob_url(picture_file.attachment), rel: "agent_#{agent.id}") else ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/nii_types_helper.rb
app/helpers/nii_types_helper.rb
module NiiTypesHelper end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/page_helper.rb
app/helpers/page_helper.rb
module PageHelper def check_all_button(param, label) html = <<-EOF <button type="button" id="check_all_#{param}">#{label}</button> <script> $(function(){ $("#check_all_#{param}").click(function(e){ var checkboxes = $("input##{param}"); checkboxes.prop("checked", !checkbox...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/enju_leaf/application_helper.rb
app/helpers/enju_leaf/application_helper.rb
module EnjuLeaf module ApplicationHelper # 使用中のデータベースのアダプタ名を表示します。 def database_adapter case ActiveRecord::Base.connection.adapter_name when "PostgreSQL" link_to "PostgreSQL", "https://www.postgresql.org/" when "MySQL" link_to "MySQL", "https://www.mysql.com/" when "SQL...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/enju_biblio/application_helper.rb
app/helpers/enju_biblio/application_helper.rb
module EnjuBiblio module ApplicationHelper def form_icon(carrier_type) unless carrier_type return image_tag("icons/help.png", size: "16x16", class: "enju_icon", alt: t("page.unknown")) end if carrier_type.attachment.attached? image_tag(carrier_type.attachment.representation(resi...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/enju_manifestation_viewer/book_jacket_helper.rb
app/helpers/enju_manifestation_viewer/book_jacket_helper.rb
module EnjuManifestationViewer module BookJacketHelper def book_jacket(manifestation) if manifestation.picture_files.exists? link = "" manifestation.picture_files.each_with_index do |picture_file, i| next unless picture_file.attachment.attached? link += if i == 0 ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/enju_manifestation_viewer/manifestation_viewer_helper.rb
app/helpers/enju_manifestation_viewer/manifestation_viewer_helper.rb
module EnjuManifestationViewer module ManifestationViewerHelper extend ApplicationHelper end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/enju_manifestation_viewer/application_helper.rb
app/helpers/enju_manifestation_viewer/application_helper.rb
module EnjuManifestationViewer module ApplicationHelper def google_book_search_preview(isbn) render partial: "manifestations/google_book_search", locals: { isbn: isbn } end def embed_content(manifestation) if manifestation.youtube_id render partial: "manifestations/youtube", locals: {...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/helpers/enju_bookmark/application_helper.rb
app/helpers/enju_bookmark/application_helper.rb
module EnjuBookmark module ApplicationHelper def link_to_tag(tag) link_to tag, manifestations_path(tag: tag.name) end def render_tag_cloud(tags, options = {}) # TODO: add options to specify different limits and sorts # tags = Tag.all(:limit => 100, :order => 'taggings_count DESC').sort_...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/content_type_policy.rb
app/policies/content_type_policy.rb
class ContentTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Administrator") end def show? true if user.try(:has_role?, "Administrator") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/create_type_policy.rb
app/policies/create_type_policy.rb
class CreateTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end de...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/bookmark_policy.rb
app/policies/bookmark_policy.rb
class BookmarkPolicy < ApplicationPolicy def index? user.try(:has_role?, "User") end def show? case user.try(:role).try(:name) when "Administrator" true when "Librarian" true when "User" if record.user == user true elsif user.profile.try(:share_bookmarks) ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/checkin_policy.rb
app/policies/checkin_policy.rb
class CheckinPolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?, "Librar...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/manifestation_custom_property_policy.rb
app/policies/manifestation_custom_property_policy.rb
class ManifestationCustomPropertyPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administra...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/event_policy.rb
app/policies/event_policy.rb
class EventPolicy < ApplicationPolicy def index? true end def show? true end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/checked_item_policy.rb
app/policies/checked_item_policy.rb
class CheckedItemPolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?, "Li...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/withdraw_policy.rb
app/policies/withdraw_policy.rb
class WithdrawPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy?...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/agent_relationship_policy.rb
app/policies/agent_relationship_policy.rb
class AgentRelationshipPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? true if user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/inventory_policy.rb
app/policies/inventory_policy.rb
class InventoryPolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Applicationistrator") end def update? user.try(:has_role?, "Applicationistrator") end def destroy? user.t...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/checkout_policy.rb
app/policies/checkout_policy.rb
class CheckoutPolicy < ApplicationPolicy def index? true end def show? if user.try(:has_role?, "Librarian") true elsif user && (user == record.user) true end end def create? user.try(:has_role?, "Librarian") end def update? if user.try(:has_role?, "Librarian") ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/user_group_policy.rb
app/policies/user_group_policy.rb
class UserGroupPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? return false unless record.profiles.empty? user.try(:ha...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/subject_type_policy.rb
app/policies/subject_type_policy.rb
class SubjectTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end d...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/news_post_policy.rb
app/policies/news_post_policy.rb
class NewsPostPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? true if user.try(:has_role?, "Administrator") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/order_policy.rb
app/policies/order_policy.rb
class OrderPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/purchase_request_policy.rb
app/policies/purchase_request_policy.rb
class PurchaseRequestPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "User") end def show? if user.try(:has_role?, "Librarian") true elsif user.try(:has_role?, "User") true if record.user == user end end def create? true if user.try(:has_role?, "User") en...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/event_export_file_policy.rb
app/policies/event_export_file_policy.rb
class EventExportFilePolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?,...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/user_group_has_checkout_type_policy.rb
app/policies/user_group_has_checkout_type_policy.rb
class UserGroupHasCheckoutTypePolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Administrator") end def update? user.try(:has_role?, "Administrator") end def destroy? use...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/participate_policy.rb
app/policies/participate_policy.rb
class ParticipatePolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?, "Li...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/classification_policy.rb
app/policies/classification_policy.rb
class ClassificationPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? true if user.try(:has_role?, "Administrator") end end...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/subject_policy.rb
app/policies/subject_policy.rb
class SubjectPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? true if user.try(:has_role?, "Administrator") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/series_statement_policy.rb
app/policies/series_statement_policy.rb
class SeriesStatementPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Librarian") end def edit? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/create_policy.rb
app/policies/create_policy.rb
class CreatePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? true if user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/loc_search_policy.rb
app/policies/loc_search_policy.rb
class LocSearchPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/news_feed_policy.rb
app/policies/news_feed_policy.rb
class NewsFeedPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/application_policy.rb
app/policies/application_policy.rb
class ApplicationPolicy attr_reader :user, :record def initialize(user, record) @user = user @record = record end def index? false end def show? false # scope.where(id: record.id).exists? end def create? false end def new? create? end def update? false end...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/agent_relationship_type_policy.rb
app/policies/agent_relationship_type_policy.rb
class AgentRelationshipTypePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? true if user.try(:has_role?, "Administrator") ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/picture_file_policy.rb
app/policies/picture_file_policy.rb
class PictureFilePolicy < ApplicationPolicy def index? true end def show? case user.try(:role).try(:name) when "Librarian" true when "User" true if record.picture_attachable.try(:required_role_id).to_i <= 2 else true if record.picture_attachable.try(:required_role_id).to_i <...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/agent_import_file_policy.rb
app/policies/agent_import_file_policy.rb
class AgentImportFilePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def d...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/library_group_policy.rb
app/policies/library_group_policy.rb
class LibraryGroupPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def show_logo? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/periodical_policy.rb
app/policies/periodical_policy.rb
class PeriodicalPolicy < ApplicationPolicy class Scope def initialize(user, scope) @user = user @scope = scope end def resolve role_id = user&.role&.id || 1 scope.joins(:manifestation).where("manifestations.required_role_id <= ?", role_id) end private attr_reader :u...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/user_checkout_stat_policy.rb
app/policies/user_checkout_stat_policy.rb
class UserCheckoutStatPolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/resource_import_file_policy.rb
app/policies/resource_import_file_policy.rb
class ResourceImportFilePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end de...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/produce_policy.rb
app/policies/produce_policy.rb
class ProducePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? true if user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/nii_type_policy.rb
app/policies/nii_type_policy.rb
class NiiTypePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? if user.try(:has_role?, "Administrator") true unless rec...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/resource_import_result_policy.rb
app/policies/resource_import_result_policy.rb
class ResourceImportResultPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def destroy? false end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/item_policy.rb
app/policies/item_policy.rb
class ItemPolicy < ApplicationPolicy class Scope def initialize(user, scope) @user = user @scope = scope end def resolve role_id = user&.role&.id || 1 scope.where("items.required_role_id <= ?", role_id) end private attr_reader :user, :scope end def index? t...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/subscribe_policy.rb
app/policies/subscribe_policy.rb
class SubscribePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/subject_heading_type_policy.rb
app/policies/subject_heading_type_policy.rb
class SubjectHeadingTypePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? if user.try(:has_role?, "Administrator") true...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/agent_type_policy.rb
app/policies/agent_type_policy.rb
class AgentTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/language_policy.rb
app/policies/language_policy.rb
class LanguagePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? true if user.try(:has_role?, "Administrator") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/event_category_policy.rb
app/policies/event_category_policy.rb
class EventCategoryPolicy < ApplicationPolicy def index? true end def show? true end def create? user.try(:has_role?, "Administrator") end def update? user.try(:has_role?, "Administrator") end def destroy? if user.try(:has_role?, "Administrator") if record.events.empty? ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/agent_merge_list_policy.rb
app/policies/agent_merge_list_policy.rb
class AgentMergeListPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def edit? true if user.try(:has_role?, "Librarian") end def upda...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/budget_type_policy.rb
app/policies/budget_type_policy.rb
class BudgetTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end de...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/subscription_policy.rb
app/policies/subscription_policy.rb
class SubscriptionPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def dest...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/bookstore_policy.rb
app/policies/bookstore_policy.rb
class BookstorePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/series_statement_merge_policy.rb
app/policies/series_statement_merge_policy.rb
class SeriesStatementMergePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def edit? true if user.try(:has_role?, "Librarian") end de...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/role_policy.rb
app/policies/role_policy.rb
class RolePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? false end def update? true if user.try(:has_role?, "Administrator") end def destroy? false end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/event_import_result_policy.rb
app/policies/event_import_result_policy.rb
class EventImportResultPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def destroy? false end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/donate_policy.rb
app/policies/donate_policy.rb
class DonatePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/agent_merge_policy.rb
app/policies/agent_merge_policy.rb
class AgentMergePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def edit? true if user.try(:has_role?, "Librarian") end def update? ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/import_request_policy.rb
app/policies/import_request_policy.rb
class ImportRequestPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def des...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/user_export_file_policy.rb
app/policies/user_export_file_policy.rb
class UserExportFilePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Administrator") end def show? true if user.try(:has_role?, "Administrator") end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator")...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/manifestation_policy.rb
app/policies/manifestation_policy.rb
class ManifestationPolicy < ApplicationPolicy class Scope def initialize(user, scope) @user = user @scope = scope end def resolve role_id = user&.role&.id || 1 scope.where("manifestations.required_role_id <= ?", role_id) end private attr_reader :user, :scope end ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/cinii_book_policy.rb
app/policies/cinii_book_policy.rb
class CiniiBookPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/series_statement_merge_list_policy.rb
app/policies/series_statement_merge_list_policy.rb
class SeriesStatementMergeListPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def edit? true if user.try(:has_role?, "Librarian") end ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/request_type_policy.rb
app/policies/request_type_policy.rb
class RequestTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? false end def update? true if user.try(:has_role?, "Administrator") end def destroy? false end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/library_policy.rb
app/policies/library_policy.rb
class LibraryPolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? if user.try(:has_role?, "Administrator") if record.profi...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/realize_policy.rb
app/policies/realize_policy.rb
class RealizePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def destroy? true if user.try(:has_role?, "Librarian") end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/user_import_result_policy.rb
app/policies/user_import_result_policy.rb
class UserImportResultPolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def destroy? false end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/carrier_type_has_checkout_type_policy.rb
app/policies/carrier_type_has_checkout_type_policy.rb
class CarrierTypeHasCheckoutTypePolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Administrator") end def update? user.try(:has_role?, "Administrator") end def destroy? u...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/classification_type_policy.rb
app/policies/classification_type_policy.rb
class ClassificationTypePolicy < ApplicationPolicy def index? true end def show? true end def create? true if user.try(:has_role?, "Administrator") end def update? true if user.try(:has_role?, "Administrator") end def destroy? if user.try(:has_role?, "Administrator") true...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/message_policy.rb
app/policies/message_policy.rb
class MessagePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "User") end def show? case user.try(:role).try(:name) when "Administrator" true when "Librarian" true if record.try(:receiver) == user when "User" true if record.try(:receiver) == user end ...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/inventory_file_policy.rb
app/policies/inventory_file_policy.rb
class InventoryFilePolicy < ApplicationPolicy def index? user.try(:has_role?, "Librarian") end def show? user.try(:has_role?, "Librarian") end def create? user.try(:has_role?, "Librarian") end def update? user.try(:has_role?, "Librarian") end def destroy? user.try(:has_role?, "...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/app/policies/user_import_file_policy.rb
app/policies/user_import_file_policy.rb
class UserImportFilePolicy < ApplicationPolicy def index? true if user.try(:has_role?, "Librarian") end def show? true if user.try(:has_role?, "Librarian") end def create? true if user.try(:has_role?, "Librarian") end def update? true if user.try(:has_role?, "Librarian") end def de...
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false