app/soc/modules/soc_core/callback.py
changeset 2956 50ce8ac13932
parent 2925 d1de20978875
child 2959 16b4476d4cb9
equal deleted inserted replaced
2955:b799af27440e 2956:50ce8ac13932
   141     self.core.registerSidebarEntry(organization.view.getExtraMenus)
   141     self.core.registerSidebarEntry(organization.view.getExtraMenus)
   142     self.core.registerSidebarEntry(org_admin.view.getSidebarMenus)
   142     self.core.registerSidebarEntry(org_admin.view.getSidebarMenus)
   143     self.core.registerSidebarEntry(mentor.view.getSidebarMenus)
   143     self.core.registerSidebarEntry(mentor.view.getSidebarMenus)
   144     self.core.registerSidebarEntry(org_app.view.getSidebarMenus)
   144     self.core.registerSidebarEntry(org_app.view.getSidebarMenus)
   145     self.core.registerSidebarEntry(grading_survey_group.view.getSidebarMenus)
   145     self.core.registerSidebarEntry(grading_survey_group.view.getSidebarMenus)
       
   146 
       
   147   def registerRights(self):
       
   148     """Called by the server when the documetn rights should be registerd.
       
   149     """
       
   150 
       
   151     site_membership = {
       
   152         'admin': [],
       
   153         'restricted': ['host'],
       
   154         'member': ['user'],
       
   155         'list': ['host'],
       
   156         }
       
   157 
       
   158     club_membership = {
       
   159         'admin': ['host', 'club_admin'],
       
   160         'restricted': ['host', 'club_admin'],
       
   161         'member': ['host', 'club_admin', 'club_member'],
       
   162         'list': ['host', 'club_admin', 'club_member'],
       
   163         }
       
   164 
       
   165     sponsor_membership = {
       
   166         'admin': ['host'],
       
   167         'restricted': ['host'],
       
   168         'member': ['host'],
       
   169         'list': ['host'],
       
   170         }
       
   171 
       
   172     program_membership = {
       
   173         'admin': ['host'],
       
   174         'restricted': ['host', 'org_admin'],
       
   175         'member': ['host', 'org_admin', 'org_mentor', 'org_student'],
       
   176         'list': ['host', 'org_admin', 'org_mentor'],
       
   177         }
       
   178 
       
   179     organization_membership = {
       
   180         'admin': ['host', 'org_admin'],
       
   181         'restricted': ['host', 'org_admin', 'org_mentor'],
       
   182         'member': ['host', 'org_admin', 'org_mentor', 'org_student'],
       
   183         'list': ['host', 'org_admin', 'org_mentor'],
       
   184         }
       
   185 
       
   186     user_membership = {
       
   187         'admin': ['user_self'],
       
   188         'restricted': ['user_self'], # ,'friends'
       
   189         'member': ['user'],
       
   190         'list': ['user_self'],
       
   191         }
       
   192 
       
   193     self.core.registerRight('site', site_membership)
       
   194     self.core.registerRight('club': club_membership)
       
   195     self.core.registerRight('sponsor': sponsor_membership)
       
   196     self.core.registerRight('program': program_membership)
       
   197     self.core.registerRight('ghop_program': ghop_program_membership)
       
   198     self.core.registerRight('org': organization_membership)
       
   199     self.core.registerRight('ghop_org': ghop_organization_membership)
       
   200     self.core.registerRight('user': user_membership)