Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15453567
D20311.id.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.id.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
Sun, Mar 30, 12:41 PM (6 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7649180
Default Alt Text
D20311.id.diff (1 KB)
Attached To
Mode
D20311: Generalize Legalpad validation logic for "Require Signature"
Attached
Detach File
Event Timeline
Log In to Comment