Changeset 84 for waeup_product/trunk
- Timestamp:
- 25 Oct 2005, 16:18:40 (19 years ago)
- Location:
- waeup_product/trunk
- Files:
-
- 1 deleted
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r72 r84 3 3 from Products.CPSInstaller.CPSInstaller import CPSInstaller 4 4 from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent 5 from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\ 6 DepartmentManage,CourseManage 5 7 try: 6 8 from Products.CPSSubscriptions.permissions import CanNotifyContent … … 28 30 self.log("Starting %(product_name)s install" % vars() ) 29 31 30 ########################################## 31 # Actions ###( 32 ########################################## 33 if CPSSubscriptions: 32 # Roles and Permissions 33 # 34 self.verifyRoles(( 35 # A role that can manage the University. 36 'UniversityManager', 37 # A role that can manage the StudentsRecords. 38 'StudentManager', 39 # A role that can manage a Faculty. 40 'FacultyManager', 41 # A role that can manage a department. 42 'DepartmentManager', 43 # A role that can manage a Course. 44 'CourseManager', 45 )) 46 waeup_perms = { 47 UniversityManage: 48 ('Manager', 'SectionManager','UniversityManager', 49 ), 50 StudentManage: 51 ('Manager', 'SectionManager','UniversityManager', 'StudentManager' 52 ), 53 FacultyManage: 54 ('Manager', 'SectionManager','UniversityManager', 'FacultyManager' 55 ), 56 DepartmentManage: 57 ('Manager', 'SectionManager','UniversityManager', 'DepartmentManager' 58 ), 59 CourseManage: 60 ('Manager', 'SectionManager','UniversityManager', 'CourseManager' 61 ), 62 } 63 self.setupPortalPermissions(waeup_perms) 64 65 ########################################## 66 # Actions 67 ########################################## 68 if CPSSubscriptions: ###( 34 69 ptypes = "('Portal', 'CPSMailAccess Message', 'CPSMailAccess Box', 'CPSMailAccess Folder',"\ 35 70 + "'University', 'StudentsFolder', 'Student', 'Jamb')" … … 96 131 self.verifyAction('portal_discussion', **action) 97 132 98 ########################################## 99 # actions 133 ###) 134 135 # portlets ###( 136 # 137 portlets = ( 138 {'identifier': 'waeup_main_tabs', 139 'type': 'Custom Portlet', 140 'slot': 'main_tabs', 141 'order': 0, 142 'render_method': 'portlet_main_navigation', 143 'Title': 'main tabs', 144 }, 145 {'identifier': 'waeup_breadcrumbs', 146 'type': 'Breadcrumbs Portlet', 147 'slot': 'waeup_breadcrumbs', 148 'first_item': 2, 149 'display_site_root': 0, 150 'Title': 'waeup_breadcrumbs', 151 'display': 'horizontal_trail', 152 'display_hidden_folders': 0, 153 'order': 0, 154 }, 155 {'identifier': 'waeup_object_actions', 156 'type': 'Actions Portlet', 157 'slot': 'waeup_object_actions', 158 'order': 0, 159 'categories': ['object'], 160 'Title': 'waep_manager_actions', 161 }, 162 {'identifier': 'waeup_left_top', 163 'type': 'Custom Portlet', 164 'slot': 'left_top', 165 'order': 0, 166 'render_method': 'portlet_session_info', 167 'Title': 'Session Info', 168 }, 169 ) 170 self.verifyPortletContainer(self.portal.sections.waeup) 171 self.verifyPortlets(portlets, self.portal.sections.waeup) 172 173 ###) 174 175 ########################################## 176 # student actions ###( 100 177 ########################################## 101 178 actions = ( { 'tool' : 'portal_actions', … … 136 213 }, 137 214 { 'tool' : 'portal_actions', 215 'id' : 'add_faculty', 216 'name' : 'Add New Faculty', 217 'action' : 'string:${object/absolute_url}/addFaculty', 218 'permission': (), 219 'condition' : 'python: member and here.portal_type in ("University",) and "StudentManager" in member.getGroups()', 220 'category' : 'student', 221 'visible' : 1, 222 }, 223 { 'tool' : 'portal_actions', 224 'id' : 'add_department', 225 'name' : 'Add New Department', 226 'action' : 'string:${object/absolute_url}/addDepartment', 227 'permission': (), 228 'condition' : 'python: member and here.portal_type in ("Faculty",) and "StudentManager" in member.getGroups()', 229 'category' : 'student', 230 'visible' : 1, 231 }, 232 { 'tool' : 'portal_actions', 233 'id' : 'add_course', 234 'name' : 'Add New Course', 235 'action' : 'string:${object/absolute_url}/addCourse', 236 'permission': (), 237 'condition' : 'python: member and here.portal_type in ("Department",) and "StudentManager" in member.getGroups()', 238 'category' : 'student', 239 'visible' : 1, 240 }, 241 { 'tool' : 'portal_actions', 138 242 'id' : 'add_personal', 139 243 'name' : 'Add personal Data', … … 162 266 self.log("Verifying %(product_name)s skinss" % vars()) 163 267 wskins = { 'waeup_default' : 'Products/WAeUP/skins/waeup_default', 268 'waeup_faculty' : 'Products/WAeUP/skins/waeup_faculty', 164 269 'waeup_student' : 'Products/WAeUP/skins/waeup_student', 165 270 } 166 271 self.verifySkins(wskins) 167 272 self.resetSkinCache() 273 168 274 ########################################## 169 275 # portal types -
waeup_product/trunk/University.py
r68 r84 8 8 from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 9 9 from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 10 from Products.CPSDocument.CPSDocument import CPSDocument 10 11 11 12 # … … 13 14 # 14 15 15 class University(BaseBTreeFolder ):16 class University(BaseBTreeFolder,CPSDocument): 16 17 """ 17 18 Container for the various WAeUP containers -
waeup_product/trunk/WAeUPPermissions.py
r80 r84 21 21 22 22 """WAeUP Student Permissions 23 """ 24 25 from AccessControl import ModuleSecurityInfo 26 from Products.CMFCore.permissions import setDefaultRoles 27 security = ModuleSecurityInfo('Products.WAeUP.WAeUPPermissions') 23 28 24 29 # - 'University Manage' : Permission you need to manage a University 25 30 # 31 security.declarePublic('UniversityManage') 32 UniversityManage = "University Manage" 33 setDefaultRoles(UniversityManage, ('Manager', 34 'Owner',)) 35 # - 'Student Manage' : Permission you need to manage Students 36 # 37 security.declarePublic('StudentManage') 38 StudentManage = "Student Manage" 39 setDefaultRoles(StudentManage, ('Manager', 40 'FacultyManager', 41 'Owner',)) 26 42 # - 'Faculty Manage' : Permission you need to manage a Faculty 27 43 # 44 security.declarePublic('FacultyManage') 45 FacultyManage = "Faculty Manage" 46 setDefaultRoles(FacultyManage, ('Manager', 47 'FacultyManager', 48 'Owner',)) 28 49 # - 'Department Manage' : Permission you need to manage a Department 29 50 # 51 security.declarePublic('DepartmentManage') 52 DepartmentManage = "Department Manage" 53 setDefaultRoles(DepartmentManage, ('Manager', 54 'FacultyManager', 55 'Department', 56 'Owner',)) 57 # - 'Course Manage' : Permission you need to manage a Department 58 # 59 security.declarePublic('CourseManage') 60 CourseManage = "Course Manage" 61 setDefaultRoles(CourseManage, ('Manager', 62 'FacultyManager', 63 'DepartmentManager', 64 'CourseManager', 65 'Owner',)) 30 66 31 """32 33 from Products.CMFCore.permissions import setDefaultRoles34 35 universityManage = "University Manage"36 setDefaultRoles(universityManage, ('Manager', 'Owner'))37 facultyManage = "Faculty Manage"38 setDefaultRoles(facultyManage, ('Manager', 'Owner'))39 departmentManage = "Department Manage"40 setDefaultRoles(departmentManage, ('Manager', 'Owner'))41 -
waeup_product/trunk/__init__.py
r68 r84 9 9 import Faculty 10 10 import Widgets 11 import WAeUPPermissions 11 12 12 13 fti = (Students.student_fti, … … 15 16 Faculty.course_fti, 16 17 ) 18 17 19 contentClasses = (University.University, 18 20 Students.StudentsFolder, -
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r78 r84 85 85 }, 86 86 'layout': { 87 'style_prefix': 'layout_ default_',87 'style_prefix': 'layout_waeup_', 88 88 'rows': [ 89 [{'widget_id': 'LanguageSelector'}],89 #[{'widget_id': 'LanguageSelector'}], 90 90 [{'widget_id': 'Title'},], 91 91 [{'widget_id': 'Description'},], 92 [{'widget_id': 'LanguageSelectorCreation'}],92 #[{'widget_id': 'LanguageSelectorCreation'}], 93 93 ], 94 94 }, … … 790 790 ###) 791 791 792 department = { ###( 793 'widgets': {}, 794 'layout': { 795 'style_prefix': 'layout_waeup_', 796 'flexible_widgets': (), 797 'ncols': 1, 798 'rows': [], 799 }, 800 } 801 ###) 802 waeup_default = { ###( 803 'widgets': {}, 804 'layout': { 805 'style_prefix': 'layout_waeup_', 806 'flexible_widgets': (), 807 'ncols': 1, 808 'rows': [], 809 }, 810 } 811 ###) 812 792 813 course = { ###( 793 814 'widgets': { … … 888 909 }, 889 910 'layout': { 890 'style_prefix': 'layout_ default_',911 'style_prefix': 'layout_waeup_', 891 912 'flexible_widgets': (), 892 913 'ncols': 1, … … 904 925 905 926 layouts = {} 927 layouts['university'] = waeup_default 906 928 layouts['waeup_common'] = common_layout 907 929 layouts['student'] = student_layout … … 911 933 layouts['jambcreate'] = jamb_layoutcreate 912 934 layouts['jamb'] = jamb_layout 935 layouts['faculty'] = waeup_default 936 layouts['department'] = waeup_default 913 937 layouts['course'] = course 914 938 layouts['admission_status'] = admission_status -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r78 r84 6 6 from Products.CMFCore.permissions import ModifyPortalContent 7 7 from Products.CMFCore.permissions import AddPortalContent 8 from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\ 9 DepartmentManage,CourseManage 8 10 ChangePermissions = 'Change permissions' 9 11 … … 24 26 'cps_proxy_type': 'folder', 25 27 'schemas': ['metadata', 'common', 'folder'], 26 'layouts': [' waeup_common', 'folder'],27 'layout_clusters': ['metadata:metadata'], 28 'cps_section_wf': 'waeup_section_wf', 29 'actions ': ({'id': 'view',28 'layouts': ['common', 'university'], 29 'layout_clusters': ['metadata:metadata'], 30 'cps_section_wf': 'waeup_section_wf', 31 'actions_add': ({'id': 'view', 30 32 'name': 'action_view', 31 33 'action': 'university_view', 32 'permissions': ( View,)},33 {'id': ' new_content',34 'name': ' action_new_content',34 'permissions': (UniversityManage,)}, 35 {'id': 'addFaculty', 36 'name': 'Add a Faculty', 35 37 'action': 'folder_factories', 36 'permissions': ( AddPortalContent,)},38 'permissions': (UniversityManage,)}, 37 39 {'id': 'contents', 38 40 'name': 'action_folder_contents', 39 41 'action': 'folder_contents', 40 'permissions': ( ModifyPortalContent,)},42 'permissions': (UniversityManage,)}, 41 43 {'id': 'edit', 42 44 'name': 'action_edit', 43 45 'action': 'cpsdocument_edit_form', 44 'permissions': (ModifyPortalContent,)}, 46 #'action': 'cpsdocument_edit_form', 47 'permissions': (UniversityManage,)}, 45 48 {'id': 'metadata', 46 49 'name': 'action_metadata', … … 79 82 'name': 'Students', 80 83 'action': 'students_folder_view', 81 'permissions': ( View,)},84 'permissions': (UniversityManage,)}, 82 85 { 83 86 'id' : 'add_content', 84 87 'name' : 'Add Content', 85 88 'action' : 'string:${object/absolute_url}/folder_factories', 86 'condition' : 'python: member and "Manager" in member.getRoles()', 87 'permissions': (AddPortalContent,)}, 89 'permissions': (StudentManage,)}, 88 90 { 89 91 'id' : 'add_jamb', 90 92 'name' : 'Add Student JAMB', 91 93 'action' : 'string:${object/absolute_url}/create_jamb', 92 'condition' : 'python: member and "StudentManager" in member.getGroups()', 93 'permissions': (AddPortalContent,)}, 94 'permissions': (UniversityManage,)}, 94 95 {'id': 'contents', 95 96 'name': 'action_folder_contents', 96 97 'action': 'folder_contents', 97 'permissions': ( ModifyPortalContent,)},98 'permissions': (UniversityManage,)}, 98 99 {'id': 'edit', 99 100 'name': 'action_edit', 100 101 'action': 'cpsdocument_edit_form', 101 'permissions': ( ModifyPortalContent,)},102 'permissions': (UniversityManage,)}, 102 103 {'id': 'metadata', 103 104 'name': 'action_metadata', 104 105 'action': 'cpsdocument_metadata', 105 'permissions': ( ModifyPortalContent,)},106 'permissions': (UniversityManage,)}, 106 107 {'id': 'localroles', 107 108 'name': 'action_local_roles', 108 109 'action': 'folder_localrole_form', 109 'permissions': ( ChangePermissions,)},110 'permissions': (UniversityManage,)}, 110 111 ) 111 112 } … … 139 140 #'action': 'string:${object_url}/cpsdocument_view', 140 141 'condition': '', 141 'permission': ( 'View',),142 'permission': (View,), 142 143 'category': 'object', 143 144 'visible': True,}, … … 294 295 'cps_display_as_document_in_listing': True, 295 296 'schemas': ['metadata','common','faculty'], 296 'layouts': [' waeup_common',],297 'layouts': ['common','faculty'], 297 298 'flexible_layouts': (), 298 299 'layout_clusters': ['metadata:metadata'], … … 304 305 'action': 'string:${object_url}/faculty_index_html', 305 306 'condition': '', 306 'permission': ('View',), 307 'permission': (View,), 308 'category': 'object', 309 'visible': True,}, 310 {'id': 'edit', 311 'name': 'action_edit', 312 'action': 'string:${object_url}/waeup_edit_form', 313 'condition': '', 314 'permission': (UniversityManage,), 307 315 'category': 'object', 308 316 'visible': True,}, … … 327 335 'cps_display_as_document_in_listing': True, 328 336 'schemas': ['metadata','common','department'], 329 'layouts': [' waeup_common',],337 'layouts': ['department','common',], 330 338 'flexible_layouts': (), 331 339 'layout_clusters': ['metadata:metadata'], … … 338 346 'condition': '', 339 347 'permission': ('View',), 348 'category': 'object', 349 'visible': True,}, 350 {'id': 'edit', 351 'name': 'action_edit', 352 'action': 'string:${object_url}/waeup_edit_form', 353 'condition': '', 354 'permission': (FacultyManage,), 340 355 'category': 'object', 341 356 'visible': True,}, … … 360 375 'cps_display_as_document_in_listing': True, 361 376 'schemas': ['metadata','common','course'], 362 'layouts': [' waeup_common','course'],377 'layouts': ['common','course'], 363 378 'flexible_layouts': (), 364 379 'layout_clusters': ['metadata:metadata'], … … 371 386 'condition': '', 372 387 'permission': ('View',), 388 'category': 'object', 389 'visible': True,}, 390 {'id': 'edit', 391 'name': 'action_edit', 392 'action': 'string:${object_url}/waeup_edit_form', 393 'condition': '', 394 'permission': (CourseManage,), 373 395 'category': 'object', 374 396 'visible': True,}, -
waeup_product/trunk/skins/waeup_default/portlet_main_navigation.pt
r82 r84 12 12 <a href="" i18n:translate="" 13 13 tal:attributes="href string:${here/portal_url}/sections/waeup/students" 14 >Student Administration</a> 14 >Studentadministration</a> | 15 <a href="" i18n:translate="" 16 tal:attributes="href string:${here/portal_url}/sections/waeup/faculties" 17 >Faculties</a> 15 18 </tal:block> 16 19 <tal:block condition="anonymous"> -
waeup_product/trunk/skins/waeup_default/portlet_session_info.pt
r81 r84 6 6 <span i18n:translate="">You are currently logged in as 7 7 <em i18n:name="member" 8 tal:content="member" /><br /> 8 tal:content="member" /><br />with Basic Roles <span tal:content="member/getRoles" /><br /> 9 <span tal:condition="python: 0" tal:content="python:mtool.getCPSCandidateLocalRoles(context)" /> 9 10 <a href="" tal:condition="python: 'Students' in member.getGroups()" 10 11 tal:attributes="href string:${here/portal_url}/sections/waeup/students/${member}">goto your personal area</a> -
waeup_product/trunk/skins/waeup_default/university_view.py
r78 r84 12 12 return context.students.students_folder_view_student(psm=psm,groups=groups) 13 13 elif 'StudentManager' in member.getGroups(): 14 return context. students.student_folder_view_manager(psm=psm,groups=groups)14 return context.waeup_view_manager(psm=psm,groups=groups) 15 15 return context.students.students_folder_view_anon(psm=psm,groups=groups) -
waeup_product/trunk/skins/waeup_faculty/department_index_html.py
r80 r84 8 8 #return context.student_view_manager() 9 9 if member: 10 if 'Manager' in member.getRoles(): 10 if 'StudentManager' in member.getGroups(): 11 #if 'Manager' in member.getRoles(): 11 12 return context.department_view_manager() 12 13 elif 'Students' in member.getGroups(): -
waeup_product/trunk/skins/waeup_faculty/department_index_html.py~
r80 r84 1 1 ##parameters=post_id=None, REQUEST=None 2 2 3 # $Id: student_index_html.py 48 2005-10-16 15:47:22Z joachim $3 # $Id: department_index_html.py 80 2005-10-22 13:43:45Z joachim $ 4 4 5 5 """Default view for a Faculty.""" … … 9 9 if member: 10 10 if 'Manager' in member.getRoles(): 11 return context. faculty_view_manager()11 return context.department_view_manager() 12 12 elif 'Students' in member.getGroups(): 13 return context. faculty_view_student()13 return context.department_view_student() -
waeup_product/trunk/skins/waeup_faculty/faculty_index_html.py
r80 r84 7 7 8 8 #return context.student_view_manager() 9 if 'Manager' in member.getRoles(): 9 #if 'Manager' in member.getRoles(): 10 if 'StudentManager' in member.getGroups(): 10 11 return context.faculty_view_manager() 11 12 elif 'Students' in member.getGroups():
Note: See TracChangeset for help on using the changeset viewer.