Commit d1c5fe27bfa690e8aead379f640956a91d44e3e1
1 parent
49b8a45b
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
api: fix the return of user permissions
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/noosfero/api/entities.rb
| ... | ... | @@ -114,7 +114,7 @@ module Noosfero |
| 114 | 114 | expose :permissions do |user, options| |
| 115 | 115 | output = {} |
| 116 | 116 | user.person.role_assignments.map do |role_assigment| |
| 117 | - if role_assigment.resource.respond_to?(:identifier) | |
| 117 | + if role_assigment.resource.respond_to?(:identifier) && !role_assigment.role.nil? | |
| 118 | 118 | output[role_assigment.resource.identifier] = role_assigment.role.permissions |
| 119 | 119 | end |
| 120 | 120 | end | ... | ... |