Add access to statistics for users
This commit is contained in:
@ -3,11 +3,11 @@ class ExercisePolicy < AdminOrAuthorPolicy
|
|||||||
admin?
|
admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
[:show?, :study_group_dashboard?, :feedback?, :requests_for_comments?].each do |action|
|
[:show?, :study_group_dashboard?, :feedback?, :requests_for_comments?, :statistics?].each do |action|
|
||||||
define_method(action) { admin? || teacher? }
|
define_method(action) { admin? || teacher? }
|
||||||
end
|
end
|
||||||
|
|
||||||
[:clone?, :destroy?, :edit?, :statistics?, :update?].each do |action|
|
[:clone?, :destroy?, :edit?, :update?].each do |action|
|
||||||
define_method(action) { admin? || author? }
|
define_method(action) { admin? || author? }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ h1 = @exercise
|
|||||||
= row(label: '.average_worktime') do
|
= row(label: '.average_worktime') do
|
||||||
p = @exercise.average_working_time
|
p = @exercise.average_working_time
|
||||||
|
|
||||||
- Hash[:internal_users => t('.internal_users'), :external_users => t('.external_users')].each_pair do |symbol, label|
|
- Hash[:internal_users => t('.internal_users'), :external_users => t('.external_users')].each_pair if current_user.admin? do |symbol, label|
|
||||||
strong = label
|
strong = label
|
||||||
-if symbol==:external_users
|
-if symbol==:external_users
|
||||||
-working_time_array = []
|
-working_time_array = []
|
||||||
|
Reference in New Issue
Block a user