Page MenuHomePhabricator

Legalpad - allow for legalpad documents to be required to be signed for using Phabricator
ClosedPublic

Authored by btrahan on Feb 12 2015, 9:20 PM.
Tags
None
Referenced Files
F14037217: D11759.id28355.diff
Sun, Nov 10, 2:24 PM
F14018861: D11759.diff
Tue, Nov 5, 8:21 PM
F14018003: D11759.id28355.diff
Tue, Nov 5, 2:52 AM
F14000125: D11759.diff
Thu, Oct 24, 7:24 PM
F13997793: D11759.id28352.diff
Thu, Oct 24, 6:13 AM
F13993023: D11759.id28356.diff
Tue, Oct 22, 8:08 PM
F13989175: D11759.diff
Mon, Oct 21, 6:36 PM
F13980922: D11759.id28354.diff
Oct 19 2024, 1:20 PM
Subscribers

Details

Summary

Fixes T7159.

Test Plan

Created a legalpad document that needed a signature and I was required to sign it no matter what page I hit. Signed it and things worked! Added a new legalpad document and I had to sign again!

Ran unit tests and they passed!

Logged out as a user who was roadblocked into signing a bunch of stuff and it worked!

Diff Detail

Repository
rP Phabricator
Branch
T7159
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 4485
Build 4499: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

btrahan retitled this revision from to Legalpad - allow for legalpad documents to be required to be signed for using Phabricator.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
src/applications/base/controller/PhabricatorController.php
56–58

wasn't sure where this might end up getting used?

src/applications/base/controller/__tests__/PhabricatorTestController.php
36–38 ↗(On Diff #28352)

The tests that use this controller were failing, so I just added this.

For the update, two approaches:

  1. Just issue an UPDATE. As long as you're doing a raw UPDATE rather than loading/saving each session, this should be "fast enough" even for large instances, I think (I'd expect it to take a few seconds for 100K's of rows, probably). We could push it into the daemons after we get like 1M active sessions at a time or something, but that's a long time away.
  2. You could do a worker and do it page-by-page, but I don't think anyone will need that for a very long time and we'd get a cleaner result there if we wait for T5166 anyway.

Obviously, I'm in favor of UPDATE for now.

src/applications/auth/storage/PhabricatorAuthSession.php
43–45

This isn't in the .sql and doesn't seem to be used?

src/applications/base/controller/PhabricatorController.php
56–58

I figured the signature controller would need it, but we could just drop it if delegating worked fine.

src/applications/legalpad/controller/LegalpadDocumentEditController.php
164–165

We should probably only allow administrators to set this flag, since it could be wildly disruptive.

It should not be possible to set this flag if the signature type is "corporations" instead of "individausl".

src/applications/legalpad/query/LegalpadDocumentQuery.php
213–217

Consider !== null and = %d so withSignatureRequired(false) excludes these documents.

src/applications/auth/engine/PhabricatorAuthSessionEngine.php
591–595

Maybe we should only record this log if there were documents?

btrahan edited edge metadata.

updates, fully working now

btrahan edited the test plan for this revision. (Show Details)
btrahan added inline comments.
src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php
258

whoops will remove

btrahan updated this object.

remove stray print_r

epriestley edited edge metadata.

Quibbling inline.

src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php
258

debugging code

src/applications/legalpad/controller/LegalpadDocumentEditController.php
138

Can't I still select "SIGNATURE_TYPE_CORPORATION" here? I don't see a transaction validation block anywhere.

Maybe show the checkbox but disable it for non-admins?

This revision is now accepted and ready to land.Feb 12 2015, 10:41 PM

Oh, also: can I log out if I have to sign docs? Maybe that's something that we'd need noncompliantblahblah() for.

btrahan edited edge metadata.
  • add back allowLegallyNonCompliantBlahblah
    • use this where we use "allow partial sessions"
  • show the checkbox but disabled for non-admins to "require signage"
  • add some logic to the edit controller to prevent non-admins, and the type corp require sign error
This revision was automatically updated to reflect the committed changes.