Hide file types, execution environments, and teams from teachers
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
class ExecutionEnvironmentPolicy < AdminOrAuthorPolicy
|
class ExecutionEnvironmentPolicy < AdminOnlyPolicy
|
||||||
def author?
|
def author?
|
||||||
@user == @record.author
|
@user == @record.author
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class FileTypePolicy < AdminOrAuthorPolicy
|
class FileTypePolicy < AdminOnlyPolicy
|
||||||
def author?
|
def author?
|
||||||
@user == @record.author
|
@user == @record.author
|
||||||
end
|
end
|
||||||
|
@ -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|
|
||||||
|
Reference in New Issue
Block a user