| | 409 | |
|---|
| | 410 | security.declareProtected(MANAGE_PORTAL, 'resetFirstAuthor') |
|---|
| | 411 | def resetFirstAuthor(self, userid): |
|---|
| | 412 | """ If after copying, updating or some other maintenance act the first author of a resource has changed |
|---|
| | 413 | this maintenance method helps to set first author to userid """ |
|---|
| | 414 | history=self.getHistory() |
|---|
| | 415 | history[-1]['_by']=userid |
|---|
| | 416 | self.setHistory(history) |
|---|
| | 417 | self.recalculateAuthors() |
|---|
| | 418 | |
|---|
| | 419 | security.declareProtected(MANAGE_PORTAL, 'removeHistoryEntry') |
|---|
| | 420 | def removeHistoryEntry(self, index): |
|---|
| | 421 | """ If after copying, updating or some other maintenance creates a misleading history entry |
|---|
| | 422 | this maintenance method removes it. """ |
|---|
| | 423 | history=self.getHistory() |
|---|
| | 424 | del history[int(index)] |
|---|
| | 425 | self.setHistory(history) |
|---|
| | 426 | self.recalculateAuthors() |
|---|
| | 427 | |
|---|