+
+my $generic_with_roles;
+
+# Add in roles
+my $RecordClass = $Class;
+$RecordClass =~ s/_/:/g;
+if ($RecordClass->DOES("RT::Record::Role::Roles")) {
+ unless ($ROLE_MAP->{$RecordClass}) {
+ for my $role ($RecordClass->Roles) {
+ my $attrs = $RecordClass->Role($role);
+ $ROLE_MAP->{$RecordClass}{$role} = {
+ title => $role,
+ attribute => $attrs->{Column} || "$role.EmailAddress",
+ value => sub { return \($m->scomp("/Elements/ShowPrincipal", Object => $_[0]->RoleGroup($role) ) ) },
+ };
+ $ROLE_MAP->{$RecordClass}{$role . "s"} = $ROLE_MAP->{$RecordClass}{$role}
+ unless $attrs->{Single};
+ }
+ }
+ $generic_with_roles = { %{$COLUMN_MAP}, %{$ROLE_MAP->{$RecordClass}} };
+} else {
+ $generic_with_roles = { %{$COLUMN_MAP} };
+}
+
+$m->callback( COLUMN_MAP => $generic_with_roles );