Skip to content

Commit

Permalink
let managers see reports but only admins can update it
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-mj committed Oct 1, 2024
1 parent a29845b commit dc6a45c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Ability
]

DOCUMENT_MODELS = [
Report
]

PLACE_MODELS = [
Expand Down Expand Up @@ -223,8 +224,9 @@ def initialize_education(user, roles)
end

def initialize_documents(user, roles)
if roles[Role::ROLE_SECRETARIA]
if roles[:manager]
can :manage, Ability::DOCUMENT_MODELS
cannot :update, Report unless roles[Role::ROLE_ADMINISTRADOR]
end
end

Expand Down

0 comments on commit dc6a45c

Please sign in to comment.