Skip to content

Commit

Permalink
Refine permissions so that more users can view Errors for Batch
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed Feb 2, 2017
1 parent 1121cc5 commit 489f0b7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ class Ability

def initialize(current_user)
current_user ||= AuthorizedUser.new
assign_staff_permission(current_user)
assign_basic_permission if current_user
assign_batch_permission if current_user.unicorn_updates == 'Y'
end

def assign_basic_permission
can :read, UniUpdatesErrors
end

def assign_staff_permission(current_user)
can :manage, ManagementReport if current_user.mgt_rpts == 'Y'
can :create, Sal3BatchRequestsBatch if current_user.sal3_batch_req == 'Y'
can :create, UserloadRerun if current_user.userload_rerun == 'Y'
can [:read, :update], Sal3BatchRequestsBatch if current_user.sal3_breq_edit == 'Y'
assign_batch_permission if current_user.unicorn_updates == 'Y'
end

def assign_batch_permission
Expand Down

0 comments on commit 489f0b7

Please sign in to comment.