diff --git a/app/controllers/admin/book_author_types_controller.rb b/app/controllers/admin/book_author_types_controller.rb index 1135803..4ef0ec4 100644 --- a/app/controllers/admin/book_author_types_controller.rb +++ b/app/controllers/admin/book_author_types_controller.rb @@ -1,4 +1,4 @@ -class Admin::BookAuthorTypesController < ApplicationController +class Admin::BookAuthorTypesController < OrbitMemberController before_action :set_book_author_type, only: [:edit, :update, :destroy] def initialize diff --git a/app/controllers/admin/books_controller.rb b/app/controllers/admin/books_controller.rb index 9845722..132a618 100644 --- a/app/controllers/admin/books_controller.rb +++ b/app/controllers/admin/books_controller.rb @@ -24,7 +24,11 @@ class Admin::BooksController < OrbitMemberController end def edit - @members_data = Book.member_data rescue nil + if has_access? + @members_data = Book.member_data rescue nil + else + render_401 + end end def update @@ -42,12 +46,16 @@ class Admin::BooksController < OrbitMemberController end def new - @book = Book.new - @members_data = Book.member_data rescue nil + if has_access? + @book = Book.new + @members_data = Book.member_data rescue nil - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @book } + respond_to do |format| + format.html # new.html.erb + format.xml { render :xml => @book } + end + else + render_401 end end @@ -65,11 +73,15 @@ class Admin::BooksController < OrbitMemberController end def book_setting - @set_author_type = BookAuthorType.new(display: 'List') - @author_type_url = admin_books_path - - @set_book_type = BookType.new(display: 'List') - @book_type_url = admin_books_path + if current_user.is_admin? + @set_author_type = BookAuthorType.new(display: 'List') + @author_type_url = admin_books_path + + @set_book_type = BookType.new(display: 'List') + @book_type_url = admin_books_path + else + render_401 + end end def destroy diff --git a/app/views/admin/books/_writing_book.html.erb b/app/views/admin/books/_writing_book.html.erb index 4cde60e..cb08834 100644 --- a/app/views/admin/books/_writing_book.html.erb +++ b/app/views/admin/books/_writing_book.html.erb @@ -5,10 +5,10 @@ <%= link_to writing_book.create_link, page_for_book(writing_book), target: "blank" %>
<% end -%> | <%= t('personal_journal.year') %> | @@ -59,7 +59,7 @@ <% @books.each do |book| %>||
---|---|---|---|
<%= check_box_tag 'to_change[]', book.id.to_s, false, :class => "list-check" %> | @@ -67,12 +67,14 @@<%= book.year %> |
<%= link_to book.create_link, page_for_book(book), target: "blank"%>
-
-
+ <% if has_access? %>
+
-
+
+ <% end %>
+ |
<%= book.authors %> | @@ -83,7 +85,7 @@