Class: Blogaze::Controllers::Admin::Controller

Inherits:
Controller
  • Object
show all
Defined in:
lib/blogaze/controllers/admin/init.rb

Direct Known Subclasses

Comments, Dashboard, Pages, Posts, Settings, Users

Instance Method Summary collapse

Methods inherited from Controller

#get_settings, #title, #view_file

Constructor Details

#initializeController

Returns a new instance of Controller.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/blogaze/controllers/admin/init.rb', line 16

def initialize
  super

  # Set AdminCP title
  title "Admin"

  # Make sure the user is logged in and has permission
  if !@userinfo.respond_to?('group') or @userinfo.group.is_admin != 1
    redirect '/login'
  end
end