Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | |||
3 | from bika.lims.api.security import check_permission |
||
4 | from .permissions import AddWorksheet |
||
5 | from .permissions import ManageWorksheets |
||
6 | from .permissions import EditWorksheet |
||
7 | from .permissions import WorksheetAddAttachment |
||
8 | |||
9 | |||
10 | def can_add_worksheet(context): |
||
11 | """Checks if worksheets can be added in context |
||
12 | """ |
||
13 | return check_permission(AddWorksheet, context) |
||
14 | |||
15 | |||
16 | def can_edit_worksheet(context): |
||
17 | """Checks if worksheets can be managed in context |
||
18 | """ |
||
19 | return check_permission(EditWorksheet, context) |
||
20 | |||
21 | |||
22 | def can_manage_worksheets(context): |
||
23 | """Checks if worksheets can be managed in context |
||
24 | """ |
||
25 | return check_permission(ManageWorksheets, context) |
||
26 | |||
27 | |||
28 | def can_add_worksheet_attachment(context): |
||
29 | """Checks if attachments can be added to worksheet |
||
30 | """ |
||
31 | return check_permission(WorksheetAddAttachment, context) |
||
32 |