equal
deleted
inserted
replaced
18 # import interfaces |
18 # import interfaces |
19 from pyams_security.interfaces import ISecurityManager |
19 from pyams_security.interfaces import ISecurityManager |
20 from pyams_security.interfaces.notification import INotificationSettings |
20 from pyams_security.interfaces.notification import INotificationSettings |
21 from pyams_security.zmi.interfaces import ISecurityManagerMenu |
21 from pyams_security.zmi.interfaces import ISecurityManagerMenu |
22 from pyams_skin.layer import IPyAMSLayer |
22 from pyams_skin.layer import IPyAMSLayer |
23 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION, MANAGE_SYSTEM_PERMISSION |
23 from pyams_utils.interfaces import MANAGE_SYSTEM_PERMISSION |
24 from pyams_zmi.layer import IAdminLayer |
24 from pyams_zmi.layer import IAdminLayer |
25 from zope.component.interfaces import ISite |
25 from zope.component.interfaces import ISite |
26 |
26 |
27 # import packages |
27 # import packages |
28 from pyams_form.form import AJAXEditForm |
28 from pyams_form.form import AJAXEditForm |
37 |
37 |
38 from pyams_security import _ |
38 from pyams_security import _ |
39 |
39 |
40 |
40 |
41 @viewlet_config(name='notifications.menu', context=ISite, layer=IAdminLayer, manager=ISecurityManagerMenu, |
41 @viewlet_config(name='notifications.menu', context=ISite, layer=IAdminLayer, manager=ISecurityManagerMenu, |
42 permission=VIEW_SYSTEM_PERMISSION, weight=2) |
42 permission=MANAGE_SYSTEM_PERMISSION, weight=2) |
43 class SecurityManagerNotificationsMenuItem(MenuItem): |
43 class SecurityManagerNotificationsMenuItem(MenuItem): |
44 """Notifications properties menu item""" |
44 """Notifications properties menu item""" |
45 |
45 |
46 label = _("Notifications...") |
46 label = _("Notifications...") |
47 url = 'notifications.html' |
47 url = 'notifications.html' |
51 manager = query_utility(ISecurityManager) |
51 manager = query_utility(ISecurityManager) |
52 return resource_url(manager, self.request, self.url) |
52 return resource_url(manager, self.request, self.url) |
53 |
53 |
54 |
54 |
55 @pagelet_config(name='notifications.html', context=ISecurityManager, layer=IPyAMSLayer, |
55 @pagelet_config(name='notifications.html', context=ISecurityManager, layer=IPyAMSLayer, |
56 permission=VIEW_SYSTEM_PERMISSION) |
56 permission=MANAGE_SYSTEM_PERMISSION) |
57 class SecurityManagerNotificationsEditForm(AdminDialogEditForm): |
57 class SecurityManagerNotificationsEditForm(AdminDialogEditForm): |
58 """Security manager notifications edit form""" |
58 """Security manager notifications edit form""" |
59 |
59 |
60 title = _("System security manager") |
60 title = _("System security manager") |
61 legend = _("Notifications properties") |
61 legend = _("Notifications properties") |