mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
add checks
This commit is contained in:
1 parent
6fb247ec06
commit
10d45c3e20
6 files changed
+24
-6
No files matched your search
@@ -108,13 +108,16 @@ class StartFormController < ApplicationController
|
||||
end
|
||||
|
||||
def can_resubmit?(submitter)
|
||||
%w[api embed mcp].exclude?(submitter.submission.source) &&
|
||||
submitter.completed_at? && submitter.completed_at > 14.days.ago &&
|
||||
%w[api embed mcp].exclude?(submitter.submission.source) &&
|
||||
submitter.account.account_configs.find_or_initialize_by(key: AccountConfig::ALLOW_TO_RESUBMIT).value != false
|
||||
end
|
||||
|
||||
def authorize_start!
|
||||
return redirect_to submit_form_path(@resubmit_submitter.slug) if @resubmit_submitter && @template.archived_at?
|
||||
return redirect_to start_form_path(@template.slug) if @template.archived_at?
|
||||
is_archived = @template.archived_at? || @template.account.archived_at?
|
||||
|
||||
return redirect_to submit_form_path(@resubmit_submitter.slug) if @resubmit_submitter && is_archived
|
||||
return redirect_to start_form_path(@template.slug) if is_archived
|
||||
|
||||
return if @resubmit_submitter
|
||||
return if @template.shared_link? || (current_user && current_ability.can?(:read, @template))
|
||||
|
||||
Reference in new issue
Block a user