Skip to content
Snippets Groups Projects
Commit 9be5585f authored by Arnaud Levy's avatar Arnaud Levy
Browse files

rights and path

parent fa8a9ba3
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ class Ability
can :manage, Communication::Website::Page, university_id: @user.university_id
can :manage, Communication::Website::Post, university_id: @user.university_id
can :manage, Communication::Website::Category, university_id: @user.university_id
can :manage, Communication::Website::Block, university_id: @user.university_id
can :manage, Communication::Website::Home, university_id: @user.university_id
can :manage, Communication::Website::Structure, university_id: @user.university_id
can [:read, :update, :reorder], Communication::Website::Menu, university_id: @user.university_id
......
......@@ -27,13 +27,19 @@
class Communication::Website::IndexPage < ApplicationRecord
has_summernote :text
enum kind: { home: 0,
communication_posts: 10,
education_programs: 20,
research_articles: 30, research_volumes: 32,
persons: 100, administrators: 110, authors: 120, researchers: 130, teachers: 140
}
enum kind: {
home: 0,
communication_posts: 10,
education_programs: 20,
research_articles: 30,
research_volumes: 32,
persons: 100,
administrators: 110,
authors: 120,
researchers: 130,
teachers: 140
}
belongs_to :university
belongs_to :website, foreign_key: :communication_website_id
......
......@@ -85,7 +85,7 @@ class Communication::Website::Post < ApplicationRecord
def url
return unless published
return if website.url.blank?
"#{website.url}#{path}"
"#{website.url}#{website.index_for(:communication_posts).path}#{path}"
end
def to_s
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment