Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18842755
D20311.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20311.diff
View Options
diff --git a/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php b/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
--- a/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
+++ b/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
@@ -55,11 +55,22 @@
public function validateTransactions($object, array $xactions) {
$errors = array();
- $is_admin = $this->getActor()->getIsAdmin();
+ $old = (bool)$object->getRequireSignature();
+ foreach ($xactions as $xaction) {
+ $new = (bool)$xaction->getNewValue();
- if (!$is_admin) {
- $errors[] = $this->newInvalidError(
- pht('Only admins may require signature.'));
+ if ($old === $new) {
+ continue;
+ }
+
+ $is_admin = $this->getActor()->getIsAdmin();
+ if (!$is_admin) {
+ $errors[] = $this->newInvalidError(
+ pht(
+ 'Only administrators may change whether a document '.
+ 'requires a signature.'),
+ $xaction);
+ }
}
return $errors;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 29, 6:16 PM (1 w, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8503677
Default Alt Text
D20311.diff (1 KB)
Attached To
Mode
D20311: Generalize Legalpad validation logic for "Require Signature"
Attached
Detach File
Event Timeline
Log In to Comment