diff --git a/app/models/ability.rb b/app/models/ability.rb index f46c382..018c5b4 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -10,7 +10,7 @@ class Ability can :read, Forum, :state => true, :category => { :state => true } can :read, Topic, :forum => { :state => true, :category => { :state => true } } can :read, Post, :topic => { :forum => { :state => true, :category => { :state => true } } } - + can :update, Post, :user_id => user.id, :topic => { :locked => false } can :destroy, [Topic,Post], :user_id => user.id, :topic => { :locked => false } diff --git a/app/models/user.rb b/app/models/user.rb index aa2be83..c0c59b4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,6 +16,6 @@ class User < ActiveRecord::Base has_many :posts, :dependent => :destroy def admin? - true if self.username == 'admin' + self.is_admin end end diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index c241b63..387fdb4 100755 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,6 +1,7 @@
<%= t :welcome_msg %>
<%= devise_error_messages! %><%= t :welcome_msg %>