If user are able to edit and view their submissions, the private fields are visible for them.

Is it a bug or is it as expected. I need private fileds for staff comments f.e

ADDENDUM:

1) Components are displayed as a submission without regard to either private or webform results access. When displayed as a form, access is allowed when either the component isn't private OR the user was access to the webform results for this submission. This same access should be extended to the viewed results.

2) As part of a similar typo, the additional classes and wrapper are not added to viewed submission. Normallyt he class maybe omitted due to the simplicity of the output of the component, but the wrapper class should be included. While unrelated by symptom, this bug is caused by the exact same error in the code.

Comments

danchadwick’s picture

Status: Active » Fixed

You will need to implement your own access, in that case. Private fields are visible to the submitter.

etron770’s picture

the strange thing is, that the private fields are unvisible when submitting the form, but not when viewing the form again.

do you know where in the code I can implement the access?

danchadwick’s picture

Category: Support request » Bug report
Status: Fixed » Active

Hmmm. Actually that sounds like a bug. Now the question is what is the expected behavior for a user who does NOT have access to "own webform results" for a private component while viewing the form, in the process of submitting a draft, viewing a submission, and editing a submission.

danchadwick’s picture

Title: Private fields on view submission » When viewing a submission, private components may be shown inappropriately and classes omitted
Issue summary: View changes

  • DanChadwick committed f98b390 on 7.x-4.x
    Issue #2335547 by DanChadwick: Fixed When viewing a submission, private...
  • DanChadwick committed e914fa7 on 8.x-4.x
    Issue #2335547 by DanChadwick: Fixed When viewing a submission, private...
danchadwick’s picture

Status: Active » Fixed
StatusFileSize
new1.38 KB

Committed to 7.x-4.x and 8.x.

etron770’s picture

#3
It would be really great (if possible) to have:
a (private) component with follwong checkboxes:
write access for special rules (checkboxes) and an additional for writeacces for the submitter

read access for special rules (checkboxes) and an additional checkbox for readacces for the submitter.

Example:
I have an registration form for a conference. There is are private fields for
registration date
payment date
pamyent ammount
these 3 must be edit by special roles and visible for the submitter (or a speciale role)

and I have a
comment text area

where I can write some staff comments which must not be visible to the submitter

danchadwick’s picture

@etron770 -- This sort of specialized programming would not be part of webform. It sounds like you need a combination of hook_form_alter and the webform access api functions. We don't offer programming support in the webform issue queue, however. Try the forums or IRC.

etron770’s picture

#6
Thank your for your support (the patch is working fine)

#9
Maybe I am not the only one who would like to have this. I other words and maybe more simple:
It would be nice to have a checkbox to change that the admin is able to change and the submitter is able to see the values.
In other words a combination from before and after the patch as a new checkbox

We don't offer programming support in the webform issue queue,

sorry this was not my intention, I get the data easily, using markup field and PHP

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.