Ignore:
Timestamp:
25 Oct 2005, 16:18:40 (19 years ago)
Author:
joachim
Message:

=Roles and Facultymanagement, new themes used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/Extensions/install.py

    r72 r84  
    33from Products.CPSInstaller.CPSInstaller import CPSInstaller
    44from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent
     5from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\
     6                                            DepartmentManage,CourseManage
    57try:
    68  from Products.CPSSubscriptions.permissions import CanNotifyContent
     
    2830        self.log("Starting %(product_name)s install" % vars() )
    2931   
    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: ###(
    3469            ptypes = "('Portal', 'CPSMailAccess Message', 'CPSMailAccess Box', 'CPSMailAccess Folder',"\
    3570                     +  "'University', 'StudentsFolder', 'Student', 'Jamb')"
     
    96131            self.verifyAction('portal_discussion', **action)
    97132       
    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 ###(
    100177        ##########################################
    101178        actions = ( { 'tool'      : 'portal_actions',
     
    136213                      },
    137214                      { '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',
    138242                        'id'        : 'add_personal',
    139243                        'name'      : 'Add personal Data',
     
    162266        self.log("Verifying %(product_name)s skinss" % vars())
    163267        wskins = { 'waeup_default' : 'Products/WAeUP/skins/waeup_default',
     268                   'waeup_faculty' : 'Products/WAeUP/skins/waeup_faculty',
    164269                   'waeup_student' : 'Products/WAeUP/skins/waeup_student',
    165270                 }
    166271        self.verifySkins(wskins)
    167272        self.resetSkinCache()
     273       
    168274        ##########################################
    169275        # portal types
Note: See TracChangeset for help on using the changeset viewer.