@@ -122,7 +122,7 @@
|
||||
userId = this.get('user_id');
|
||||
if (userId) {
|
||||
this.set('staff_authored', DiscussionUtil.isStaff(userId));
|
||||
this.set('community_ta_authored', DiscussionUtil.isTA(userId));
|
||||
this.set('community_ta_authored', DiscussionUtil.isTA(userId) || DiscussionUtil.isGroupTA(userId));
|
||||
} else {
|
||||
this.set('staff_authored', false);
|
||||
this.set('community_ta_authored', false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* globals $$course_id, Content, Markdown, MathJax, URI */
|
||||
/* globals $$course_id, Content, Markdown, MathJax, URI, _ */
|
||||
(function() {
|
||||
'use strict';
|
||||
this.DiscussionUtil = (function() {
|
||||
@@ -41,6 +41,16 @@
|
||||
return _.include(ta, parseInt(userId));
|
||||
};
|
||||
|
||||
DiscussionUtil.isGroupTA = function(userId) {
|
||||
var groupTa,
|
||||
localUserId = userId;
|
||||
if (_.isUndefined(userId)) {
|
||||
localUserId = this.user ? this.user.id : void 0;
|
||||
}
|
||||
groupTa = _.union(this.roleIds['Group Moderator']);
|
||||
return _.include(groupTa, parseInt(localUserId, 10));
|
||||
};
|
||||
|
||||
DiscussionUtil.isPrivilegedUser = function(userId) {
|
||||
return this.isStaff(userId) || this.isTA(userId);
|
||||
};
|
||||
|
||||
@@ -508,7 +508,8 @@
|
||||
return _.template($('#post-user-display-template').html())({
|
||||
username: endorsement.username,
|
||||
user_url: DiscussionUtil.urlFor('user_profile', endorsement.user_id),
|
||||
is_community_ta: DiscussionUtil.isTA(endorsement.user_id),
|
||||
is_community_ta: DiscussionUtil.isTA(endorsement.user_id) ||
|
||||
DiscussionUtil.isGroupTA(endorsement.user_id),
|
||||
is_staff: DiscussionUtil.isStaff(endorsement.user_id)
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user