Merge pull request #1622 from ether/fix/submitting-submitting-faked-changesets
Fix clearing authorship colors which was broken by #1609
This commit is contained in:
commit
84d44d5f0e
|
@ -551,11 +551,20 @@ function handleUserChanges(client, message)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Validate all 'author' attribs to be the same value as the current user
|
// Validate all added 'author' attribs to be the same value as the current user
|
||||||
wireApool.eachAttrib(function(type, value) {
|
var iterator = Changeset.opIterator(Changeset.unpack(changeset).ops)
|
||||||
if('author' == type && value != thisSession.author) throw "Trying to submit changes as another author"
|
, op
|
||||||
|
while(iterator.hasNext()) {
|
||||||
|
op = iterator.next()
|
||||||
|
if(op.opcode != '+') continue;
|
||||||
|
op.attribs.split('*').forEach(function(attr) {
|
||||||
|
if(!attr) return
|
||||||
|
attr = wireApool.getAttrib(attr)
|
||||||
|
if(!attr) return
|
||||||
|
if('author' == attr[0] && attr[1] != thisSession.author) throw "Trying to submit changes as another author"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
// There is an error in this changeset, so just refuse it
|
// There is an error in this changeset, so just refuse it
|
||||||
|
|
Loading…
Reference in New Issue