forked from bofh/fetsite
themen spezifische rollen
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user