forked from docusign/code-examples-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eg026_service.rb
57 lines (52 loc) · 1.95 KB
/
eg026_service.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# frozen_string_literal: true
class ESign::Eg026Service
include ApiCreator
attr_reader :args, :request, :permission_profile_id
def initialize(session, request)
@args = {
account_id: session[:ds_account_id],
base_path: session[:ds_base_path],
access_token: session[:ds_access_token]
}
@request = request
@permission_profile_id = request.params[:lists]
end
def call
accounts_api = create_account_api(args)
permission_profile_settings = make_permission_profile_settings
update_permission_profile = accounts_api.update_permission_profile(args[:account_id], permission_profile_id,
permission_profile_settings, options = DocuSign_eSign::UpdatePermissionProfileOptions.default)
end
private
def make_permission_profile_settings
permission_profile = DocuSign_eSign::PermissionProfile.new
pr_settings = ({
useNewDocuSignExperienceInterface: 0,
allowBulkSending: "true",
allowEnvelopeSending: "true",
allowSignerAttachments: "true",
allowTaggingInSendAndCorrect:"true",
allowWetSigningOverride:"true",
allowedAddressBookAccess:"personalAndShared",
allowedTemplateAccess: "share",
enableRecipientViewingNotifications:"true",
enableSequentialSigningInterface:"true",
receiveCompletedSelfSignedDocumentsAsEmailLinks:"false",
signingUiVersion:"v2",
useNewSendingInterface:"true",
allowApiAccess:"true",
allowApiAccessToAccount:"true",
allowApiSendingOnBehalfOfOthers:"true",
allowApiSequentialSigning:"true",
enableApiRequestLogging:"true",
allowDocuSignDesktopClient:"false",
allowSendersToSetRecipientEmailLanguage:"true",
allowVaulting:"false",
allowedToBeEnvelopeTransferRecipient: "true",
enableTransactionPointIntegration: "false",
powerFormRole: "admin",
vaultingMode: "none"
})
permission_profile.settings = pr_settings
end
end