Skip to content

Commit

Permalink
Small fix to improve the permission debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
parthaa committed Nov 15, 2011
1 parent de07afd commit 8a7b1a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/models/permission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ def resource_type_attributes=(attributes)

def to_text
v = (all_verbs? && "any action") || verbs.collect { |v| v.verb }.join(',')
t = (all_tags? && "all scopes") || "scopes #{tags.collect { |t| t.name }.join(',')}"
t = (all_tags? && "all scopes") || "scopes #{tags.join(',')}"
name = (all_types? && "all_resources") || resource_type.name
org_id = (organization && "in organization #{organization.id}") || " across all organizations."
"Role #{role.name}'s allowed to perform #{v} on #{t} for #{name} #{org_id}"
end

def to_abbrev_text
v = (all_verbs? && "all_verbs") || "[#{verbs.collect { |v| v.verb }.join(',')}]"
t = (all_tags? && "all_tags") || "[#{tags.collect { |t| t.name }.join(',')}]"
t = (all_tags? && "all_tags") || "[#{tags.join(',')}]"
name = (all_types? && "all_resources") || resource_type.name
org_id = (organization && "#{organization.id}") || "all organizations"
"#{v}, #{name}, #{t}, #{org_id}"
Expand Down

0 comments on commit 8a7b1a1

Please sign in to comment.