[#1677] Extract NewUser::DossiersController#owns_dossier?
This commit is contained in:
parent
baf881a38b
commit
b606afee3f
1 changed files with 5 additions and 1 deletions
|
@ -103,7 +103,7 @@ module NewUser
|
|||
end
|
||||
|
||||
def ensure_ownership!
|
||||
if dossier.user_id != current_user.id
|
||||
if !owns_dossier?
|
||||
forbidden!
|
||||
end
|
||||
end
|
||||
|
@ -127,6 +127,10 @@ module NewUser
|
|||
params.require(:dossier).permit(:autorisation_donnees)
|
||||
end
|
||||
|
||||
def owns_dossier?
|
||||
dossier.user_id == current_user.id
|
||||
end
|
||||
|
||||
def draft?
|
||||
params[:submit_action] == 'draft'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue