forked from bofh/fetsite
Versionen für Gemfile, Für Debug Rechteverwaltung deaktiviert
This commit is contained in:
20
Gemfile
20
Gemfile
@@ -6,7 +6,7 @@ gem 'rails', '3.2.9'
|
|||||||
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
||||||
|
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
gem 'execjs'
|
gem 'execjs', '~>1.4.0'
|
||||||
|
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
@@ -40,16 +40,24 @@ gem 'jquery-rails'
|
|||||||
# gem 'debugger'
|
# gem 'debugger'
|
||||||
|
|
||||||
# Formbuilder for easier form generation
|
# Formbuilder for easier form generation
|
||||||
gem 'formtastic'
|
gem 'formtastic', '~>2.2.1'
|
||||||
gem 'formtastic-bootstrap'
|
gem 'formtastic-bootstrap'
|
||||||
gem "tinymce-rails"
|
gem "tinymce-rails" , '>=3.5.8'
|
||||||
|
|
||||||
gem "globalize3"
|
# Internationalisierung
|
||||||
|
gem "globalize3" ,'~>0.3.0'
|
||||||
|
|
||||||
gem "paper_trail"
|
# Version controll
|
||||||
|
gem "paper_trail" , '>=2.7.0'
|
||||||
|
|
||||||
gem "devise"
|
# User management
|
||||||
|
gem "devise" ,'~>2.2.3'
|
||||||
|
|
||||||
|
# Roles for users
|
||||||
gem "rolify"
|
gem "rolify"
|
||||||
|
|
||||||
|
# Abilities
|
||||||
gem "cancan"
|
gem "cancan"
|
||||||
|
|
||||||
|
# Fileupload
|
||||||
|
gem 'paperclip' ,'~>3.4.0'
|
||||||
@@ -1,21 +1,13 @@
|
|||||||
class Ability
|
class Ability
|
||||||
include CanCan::Ability
|
include CanCan::Ability
|
||||||
|
|
||||||
def initialize(user)
|
def initialize(user)
|
||||||
# Define abilities for the passed in user here. For example:
|
# Define abilities for the passed in user here. For example:
|
||||||
#
|
#
|
||||||
user ||= User.new # guest user (not logged in)
|
|
||||||
# if user.admin?
|
# if user.admin?
|
||||||
# can :manage, :all
|
# can :manage, :all
|
||||||
# else
|
# else
|
||||||
# can :read, :all
|
# can :read, :all
|
||||||
# end
|
# end
|
||||||
can :read, Modulgruppe
|
|
||||||
if user.has_role? "newsadmin"
|
|
||||||
can :manage, Modulgruppe
|
|
||||||
can :addmoderator, Modulgruppe
|
|
||||||
can :addmoderator, Rubrik
|
|
||||||
end
|
|
||||||
# The first argument to `can` is the action you are giving the user permission to do.
|
# The first argument to `can` is the action you are giving the user permission to do.
|
||||||
# If you pass :manage it will apply to every action. Other common actions here are
|
# If you pass :manage it will apply to every action. Other common actions here are
|
||||||
# :read, :create, :update and :destroy.
|
# :read, :create, :update and :destroy.
|
||||||
@@ -28,6 +20,22 @@ class Ability
|
|||||||
#
|
#
|
||||||
# can :update, Article, :published => true
|
# can :update, Article, :published => true
|
||||||
#
|
#
|
||||||
# See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities
|
# See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilitiescan :manage, :all
|
||||||
|
|
||||||
|
user ||= User.new # guest user (not logged in)
|
||||||
|
|
||||||
|
|
||||||
|
# For Debug allow everything
|
||||||
|
# Remove this line in production environment and for testing user management
|
||||||
|
can :manage, :all
|
||||||
|
|
||||||
|
# Rechteverwaltung f<>r Studien Modul
|
||||||
|
can :read, Modulgruppe
|
||||||
|
if user.has_role? "newsadmin"
|
||||||
|
can :manage, Modulgruppe
|
||||||
|
can :addmoderator, Modulgruppe
|
||||||
|
can :addmoderator, Rubrik
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user