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

Disallow results entry when sample modification is not allowed #1767

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2.0.0 (unreleased)
------------------

- #1767 Disallow results entry when sample modification is not allowed
- #1755 Set markup schema to `html/text` as default for RichText fields
- #1754 Fix KeyError in calculation validator
- #1753 Fixed indexing of partitions and missing metadata generation
Expand Down
5 changes: 5 additions & 0 deletions src/bika/lims/browser/analyses/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from DateTime import DateTime
from plone.memoize import view as viewcache
from Products.Archetypes.config import REFERENCE_CATALOG
from Products.CMFCore.permissions import ModifyPortalContent
from Products.CMFPlone.utils import safe_unicode
from senaite.app.listing import ListingView
from zope.component import getAdapters
Expand Down Expand Up @@ -297,6 +298,10 @@ def is_analysis_edition_allowed(self, analysis_brain):
# inside a deactivated Analysis Request, for instance
return False

if not self.has_permission(ModifyPortalContent, obj=self.context):
# skip any further checks if the sample can not be modified
return False

analysis_obj = self.get_object(analysis_brain)
if analysis_obj.getPointOfCapture() == 'field':
# This analysis must be captured on field, during sampling.
Expand Down