features/opensocial-samplecontainer/statefileparser.js mishandles isOwner and
isViewer
--------------------------------------------------------------------------------------
Key: SHINDIG-47
URL: https://issues.apache.org/jira/browse/SHINDIG-47
Project: Shindig
Issue Type: Bug
Components: Features
Reporter: Jamey Wood
Assignee: Kevin Brown
The statefileparser.js in opensocial-samplecontainer does not properly setup
the isOwner() and isViewer() status in certain cases. One issue is that when
owner==viewer, isOwner and isViewer are set to boolean values (instead of
functions which return booleans):
102 // If the id of the owner is the same as the viewer, then set the
viewer
103 // as the primary source of truth
104 if (!owner || (viewer && owner.getId() == viewer.getId())) {
105 owner = viewer;
106 owner.isViewer = true;
107 owner.isOwner = true;
108 }
Another issue is that the isViewer and isOwner flags are passed to
container.newPerson is the wrong order:
197 return container.newPerson(fields, isViewer, isOwner);
...vs the way they're expected (per features/opensocial-reference/container.js):
285 opensocial.Container.prototype.newPerson = function(opt_params,
opt_isOwner, opt_isViewer) {
The end result of all of this is that the isViewer() and isOwner() calls will
misbehave in many cases when using opensocial-samplecontainer.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.