Commit 9418b82ea2deaa577afe5e15c9eaf67b960e3608
1 parent
b8304468
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
sub_organizations: fix permission verification method
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
plugins/sub_organizations/lib/sub_organizations_plugin.rb
... | ... | @@ -38,7 +38,7 @@ class SubOrganizationsPlugin < Noosfero::Plugin |
38 | 38 | end |
39 | 39 | |
40 | 40 | def has_permission?(person, permission, target) |
41 | - if !target.kind_of?(Environment) && target.organization? | |
41 | + if !target.kind_of?(Environment) && !target.nil? && target.organization? | |
42 | 42 | Organization.parents(target).map do |parent| |
43 | 43 | person.has_permission_without_plugins?(permission, parent) |
44 | 44 | end.include?(true) | ... | ... |