Permalink
Browse files

Merge pull request #1953 from bp323/SAKIII-5430

SAKIII-5430 Discussion Widget: Managers can't add topics when widget set to only managers can add topics
  • Loading branch information...
2 parents 1638666 + 919e4d7 commit db7254e69e4ed427c9a0c8a7b50fd428460ec06b @christianvuerings christianvuerings committed Apr 11, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 devwidgets/discussion/javascript/discussion.js
@@ -364,11 +364,12 @@ require(["jquery", "sakai/sakai.api.core", "jquery-plugins/jquery.cookie"], func
var parseSettings = function(data){
var contact = false;
var canEditPage = false;
- if (!widgetData) {
- canEditPage = true;
- }
- else {
- canEditPage = sakai.api.Widgets.canEditContainer(widgetData);
+ // Check if the logged in user manages the discussion page or not (for a content profile or group)
+ if ((sakai_global.group &&
+ sakai.api.Groups.isCurrentUserAManager(sakai_global.group.groupId, sakai.data.me, sakai_global.group.groupData)) ||
+ (sakai_global.content_profile &&
+ sakai.api.Content.isUserAManager(sakai_global.content_profile.content_data.data, sakai.data.me))) {
+ canEditPage = true;
}
parsedSettings["ismanager"] = canEditPage;
// Anonymous can't do anything

0 comments on commit db7254e

Please sign in to comment.