Aktivere Rechtemanagement für einige Controller

This commit is contained in:
Andreas Stephanides
2013-10-26 12:49:03 +02:00
parent 37ee03676e
commit ff7c1d71bb
16 changed files with 23 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
class AttachmentsController < ApplicationController class AttachmentsController < ApplicationController
# GET /attachments # GET /attachments
# GET /attachments.json # GET /attachments.json
load_and_authorize_resource
def index def index
@attachments = Attachment.all @attachments = Attachment.all

View File

@@ -1,6 +1,7 @@
class BeispieleController < ApplicationController class BeispieleController < ApplicationController
# GET /beispiele # GET /beispiele
# GET /beispiele.json # GET /beispiele.json
load_and_authorize_resource
def index def index
@beispiele = Beispiel.all @beispiele = Beispiel.all

View File

@@ -1,6 +1,7 @@
class CalentriesController < ApplicationController class CalentriesController < ApplicationController
# GET /calentries # GET /calentries
# GET /calentries.json # GET /calentries.json
load_and_authorize_resource
def index def index
@calentries = Calentry.all @calentries = Calentry.all

View File

@@ -1,4 +1,5 @@
class ConfigController < ApplicationController class ConfigController < ApplicationController
load_and_authorize_resource
def index def index
end end

View File

@@ -1,6 +1,7 @@
class FetzneditionsController < ApplicationController class FetzneditionsController < ApplicationController
# GET /fetzneditions # GET /fetzneditions
# GET /fetzneditions.json # GET /fetzneditions.json
load_and_authorize_resource
def index def index
@fetzneditions = Fetznedition.all @fetzneditions = Fetznedition.all

View File

@@ -1,6 +1,7 @@
class FragenController < ApplicationController class FragenController < ApplicationController
# GET /fragen # GET /fragen
# GET /fragen.json # GET /fragen.json
load_and_authorize_resource
def index def index
@fragen = Frage.all @fragen = Frage.all

View File

@@ -1,6 +1,7 @@
class GremienController < ApplicationController class GremienController < ApplicationController
# GET /gremien # GET /gremien
# GET /gremien.json # GET /gremien.json
load_and_authorize_resource
before_filter {@toolbar_elements=[]} before_filter {@toolbar_elements=[]}
def verwalten def verwalten
@gremien = Gremium.all @gremien = Gremium.all

View File

@@ -1,6 +1,7 @@
class LecturersController < ApplicationController class LecturersController < ApplicationController
# GET /lecturers # GET /lecturers
# GET /lecturers.json # GET /lecturers.json
load_and_authorize_resource
def index def index
@lecturers = Lecturer.all @lecturers = Lecturer.all

View File

@@ -1,6 +1,7 @@
class LvasController < ApplicationController class LvasController < ApplicationController
# GET /lvas # GET /lvas
before_filter {@toolbar_elements =[]} before_filter {@toolbar_elements =[]}
load_and_authorize_resource
def index def index
@lvas = Lva.all @lvas = Lva.all
@toolbar_elements=[{:hicon=>'icon-plus-sign',:text =>I18n.t('lva.add'),:path => new_lva_path}] @toolbar_elements=[{:hicon=>'icon-plus-sign',:text =>I18n.t('lva.add'),:path => new_lva_path}]

View File

@@ -1,6 +1,7 @@
class MembershipsController < ApplicationController class MembershipsController < ApplicationController
# GET /memberships/new # GET /memberships/new
# GET /memberships/new.json # GET /memberships/new.json
load_and_authorize_resource
def new def new
@membership = Membership.new @membership = Membership.new
@membership.fetprofile=Fetprofile.find(params[:fetprofile_id]) @membership.fetprofile=Fetprofile.find(params[:fetprofile_id])

View File

@@ -1,6 +1,7 @@
class ModulsController < ApplicationController class ModulsController < ApplicationController
# GET /moduls # GET /moduls
# GET /moduls.json # GET /moduls.json
load_and_authorize_resource
def index def index
@moduls = Modul.all @moduls = Modul.all
if @moduls if @moduls

View File

@@ -1,5 +1,5 @@
class SemestersController < ApplicationController class SemestersController < ApplicationController
load_and_authorize_resource
def index def index
@semesters = Semester.all @semesters = Semester.all
end end

View File

@@ -1,7 +1,7 @@
class StudienController < ApplicationController class StudienController < ApplicationController
before_filter {@toolbar_elements =[]} before_filter {@toolbar_elements =[]}
# before_filter :authorize, :only => :verwalten # before_filter :authorize, :only => :verwalten
load_and_authorize_resource
def index def index
@studien = Studium.all @studien = Studium.all
@topbar_elements=[{:hicon=>'icon-list', :text=>I18n.t("studien.allestudien"),:path=>studien_path}] @topbar_elements=[{:hicon=>'icon-list', :text=>I18n.t("studien.allestudien"),:path=>studien_path}]

View File

@@ -1,6 +1,8 @@
class ThemenController < ApplicationController class ThemenController < ApplicationController
# GET /themen # GET /themen
# GET /themen.json # GET /themen.json
load_and_authorize_resource
def index def index
@themen = Thema.all @themen = Thema.all

View File

@@ -1,6 +1,7 @@
class ThemengruppenController < ApplicationController class ThemengruppenController < ApplicationController
# GET /themengruppen # GET /themengruppen
# GET /themengruppen.json # GET /themengruppen.json
load_and_authorize_resource
def index def index
@themengruppen = Themengruppe.all @themengruppen = Themengruppe.all
@toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}]

View File

@@ -28,16 +28,19 @@ class Ability
# For Debug allow everything # For Debug allow everything
# Remove this line in production environment and for testing user management # Remove this line in production environment and for testing user management
can :manage, :all # can :manage, :all
can :addfetuser, User can :addfetuser, User
can :addfetadmin, User can :addfetadmin, User
can [:show, :index], Studium can [:show, :index], Studium
can [:show, :index], Modulgruppe can [:show, :index], Modulgruppe
can [:show, :index], Modul can [:show, :index], Modul
can [:show, :index], Lva can [:show, :index], Lva
can [:show,:index], Gallery
can [:show, :index], Themengruppe
can [:show, :index], Fetprofile
can [:show],Gremium
# Rechteverwaltung fuer Studien Modul # Rechteverwaltung fuer Studien Modul
can :read, Modulgruppe
# Rechteverwaltung Kalender # Rechteverwaltung Kalender
@@ -45,7 +48,7 @@ class Ability
can [:showics], Calendar can [:showics], Calendar
can [:show], Calentry can [:show], Calentry
if( user.has_role?("fetuser") || user.has_role?("fetadmin")) if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
can :manage,:all
can :manage, Modulgruppe can :manage, Modulgruppe
can [:show,:index], Calendar can [:show,:index], Calendar