-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontrolsecuritymanager.py
34 lines (29 loc) · 1.32 KB
/
controlsecuritymanager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
###########################################################################
# Copyright (C) 2005 by kosh
#
# Copyright: See COPYING file that comes with this distribution
#
###########################################################################
from basecontrolmanager import BaseControlManager
#For Security control and init
from AccessControl import ClassSecurityInfo
import Globals
class ControlSecurityManager(BaseControlManager):
"Input text class"
meta_type = "ControlSecurityManager"
security = ClassSecurityInfo()
control_title = 'Security'
drawMode = 'view'
security.declareProtected('View management screens', 'edit')
def edit(self, *args, **kw):
"""This draws the inline forms for the objects present."""
origin = self.getOrigin()
object = origin.unrestrictedTraverse(self.getFixedUpPath(), None)
format = '<div class="%(cssClass)s"><a href="%(url)s/manage_access">%(name)s</a></div>'
if object is not None:
lookup = {'cssClass':self.cssClass, 'url': object.absolute_url_path() ,
'name': object.getId()}
return format % lookup
return ""
Globals.InitializeClass(ControlSecurityManager)