themen spezifische rollen

This commit is contained in:
Andreas Stephanides
2015-02-10 14:04:54 +01:00
parent 2b483ae9e9
commit 7326b08729
2 changed files with 2 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ class Ability
can :manage, Themengruppe can :manage, Themengruppe
can :manage, Attachment can :manage, Attachment
end end
can [:update,:edit,:verwalten, :showdraft], Thema, :id=>Thema.with_role(:editor, user).pluck(:id)
unless user.has_role?("fetadmin") unless user.has_role?("fetadmin")
cannot :delete, Themengruppe cannot :delete, Themengruppe
cannot :delete, Thema cannot :delete, Thema

View File

@@ -27,6 +27,7 @@ include Rails.application.routes.url_helpers
scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true) scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true)
default_scope order("themen.priority").reverse_order default_scope order("themen.priority").reverse_order
# scope :search, ->(query) {where("themen.text like ? or themen.title like ?", "%#{query}%", "%#{query}%")} # scope :search, ->(query) {where("themen.text like ? or themen.title like ?", "%#{query}%", "%#{query}%")}
resourcify
searchable do searchable do
text :text text :text
text :title, :boost=>4.0 text :title, :boost=>4.0