Hide file types, execution environments, and teams from teachers

This commit is contained in:
Maximilian Grundke
2016-03-02 10:57:13 +01:00
parent 0a5301a595
commit da3339ecbb
3 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
class ExecutionEnvironmentPolicy < AdminOrAuthorPolicy class ExecutionEnvironmentPolicy < AdminOnlyPolicy
def author? def author?
@user == @record.author @user == @record.author
end end

View File

@ -1,4 +1,4 @@
class FileTypePolicy < AdminOrAuthorPolicy class FileTypePolicy < AdminOnlyPolicy
def author? def author?
@user == @record.author @user == @record.author
end end

View File

@ -1,6 +1,6 @@
class TeamPolicy < ApplicationPolicy class TeamPolicy < ApplicationPolicy
[:create?, :index?, :new?].each do |action| [:create?, :index?, :new?].each do |action|
define_method(action) { @user.internal_user? } define_method(action) { admin? }
end end
[:destroy?, :edit?, :show?, :update?].each do |action| [:destroy?, :edit?, :show?, :update?].each do |action|