Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom form security levels and unexpected results #695

Closed
pdestefanis opened this issue Jul 11, 2012 · 4 comments
Closed

Custom form security levels and unexpected results #695

pdestefanis opened this issue Jul 11, 2012 · 4 comments

Comments

@pdestefanis
Copy link
Collaborator

I am testing role-based restrictions on custom forms, the implementation on 2.4:master gives me the following results. It seems this is related to fields not showing as Read-Only when the user has only "View", based on his Role and the field Access Level.

Role: High (90)
Role: Low (50)

For a field defined as

Submit: High
View: Low

Logged in as High:
Field shows - OK
Field contents show - OK
Data can be added/edited - OK

Logged in as Low:
Field shows - OK
Field contents do not show - NOT OK (the user has the level required for "View")
Data can be added. Any data added completely replaces the original data. - NOT OK (User does not have the level required to Submit)

Expected result: When logged in as Low: The field shows, the existing data shows, but the user cannot edit the data.

For a field defined as

Submit: Low
View: High

Logged in as High:
Field shows - OK
Field contents show - OK
Data can be added/edited - OK

Logged in as Low:
Field does not show - OK (since the level required for "View" should be lower or equal to that required for "Submit")

@pdestefanis
Copy link
Collaborator Author

Checked on 2.5b. The user with Read-Only (RO) permissions still can edit the field, but not see previous contents (previous contents are lost).
The field contents do not show for users with RO or RW, even if they are stored in the database (this is new in 2.5b)

@pdestefanis
Copy link
Collaborator Author

Further testing, the data in customs fields do not show regardless of the visibility set for the fields

@rjmackay
Copy link
Contributor

Been working through this - its really hard to figure out but:

  • Fixed view-only fields weren't showing data when editing - added the data
  • fields with submit but not view - these will not be editable.

Think this is now correct.

Outstanding issue: members are treated the same as 'anyone'

rjmackay added a commit to rjmackay/Ushahidi_Web that referenced this issue Apr 16, 2013
* Form field mismatch function wasn't returning sane results, rewritten
to join to the roles table as other customforms queries do.
* Field validation was checking role id against access_level. Fix to compare
access level with access level
* Fix 'view only' fields in edit to actually have data
@kamaulynder
Copy link
Contributor

Fixed, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants