Exemplo n.º 1
0
    def _get_defaults(self):
        registration_managers = {
            p.principal
            for p in self.event.acl_entries
            if p.has_management_permission('registration', explicit=True)
        }
        event_session_settings = session_settings.get_all(self.event)
        coordinator_privs = {
            name: event_session_settings[val]
            for name, val in COORDINATOR_PRIV_SETTINGS.iteritems()
            if event_session_settings.get(val)
        }
        permissions = [[
            serialize_principal(p.principal),
            list(get_principal_permissions(p, Event))
        ] for p in self.event.acl_entries]
        permissions = [item for item in permissions if item[1]]

        return dict(
            {
                'protection_mode': self.event.protection_mode,
                'registration_managers': registration_managers,
                'access_key': self.event.access_key,
                'visibility': self.event.visibility,
                'own_no_access_contact': self.event.own_no_access_contact,
                'permissions': permissions
            }, **coordinator_privs)
Exemplo n.º 2
0
 def _get_defaults(self):
     acl = {p.principal for p in self.event.acl_entries if p.read_access}
     submitters = {
         p.principal
         for p in self.event.acl_entries
         if p.has_management_role('submit', explicit=True)
     }
     managers = {
         p.principal
         for p in self.event.acl_entries if p.full_access
     }
     registration_managers = {
         p.principal
         for p in self.event.acl_entries
         if p.has_management_role('registration', explicit=True)
     }
     event_session_settings = session_settings.get_all(self.event)
     coordinator_privs = {
         name: event_session_settings[val]
         for name, val in COORDINATOR_PRIV_SETTINGS.iteritems()
         if event_session_settings.get(val)
     }
     return dict(
         {
             'protection_mode': self.event.protection_mode,
             'acl': acl,
             'managers': managers,
             'registration_managers': registration_managers,
             'submitters': submitters,
             'access_key': self.event.access_key,
             'visibility': self.event.visibility,
             'own_no_access_contact': self.event.own_no_access_contact
         }, **coordinator_privs)
Exemplo n.º 3
0
 def _get_defaults(self):
     acl = {p.principal for p in self.event_new.acl_entries if p.read_access}
     submitters = {p.principal for p in self.event_new.acl_entries if p.has_management_role("submit", explicit=True)}
     managers = {p.principal for p in self.event_new.acl_entries if p.full_access}
     registration_managers = {
         p.principal for p in self.event_new.acl_entries if p.has_management_role("registration", explicit=True)
     }
     event_session_settings = session_settings.get_all(self.event_new)
     coordinator_privs = {
         name: event_session_settings[val]
         for name, val in COORDINATOR_PRIV_SETTINGS.iteritems()
         if event_session_settings.get(val)
     }
     return dict(
         {
             "protection_mode": self.event_new.protection_mode,
             "acl": acl,
             "managers": managers,
             "registration_managers": registration_managers,
             "submitters": submitters,
             "access_key": self.event_new.access_key,
             "own_no_access_contact": self.event_new.own_no_access_contact,
         },
         **coordinator_privs
     )
Exemplo n.º 4
0
 def _get_defaults(self):
     acl = {p.principal for p in self.event_new.acl_entries if p.read_access}
     submitters = {p.principal for p in self.event_new.acl_entries if p.has_management_role('submit', explicit=True)}
     managers = {p.principal for p in self.event_new.acl_entries if p.full_access}
     registration_managers = {p.principal for p in self.event_new.acl_entries
                              if p.has_management_role('registration', explicit=True)}
     event_session_settings = session_settings.get_all(self.event_new)
     coordinator_privs = {name: event_session_settings[val] for name, val in COORDINATOR_PRIV_SETTINGS.iteritems()
                          if event_session_settings.get(val)}
     return dict({'protection_mode': self.event_new.protection_mode, 'acl': acl, 'managers': managers,
                  'registration_managers': registration_managers, 'submitters': submitters,
                  'access_key': self.event_new.access_key,
                  'own_no_access_contact': self.event_new.own_no_access_contact}, **coordinator_privs)
Exemplo n.º 5
0
    def _get_defaults(self):
        registration_managers = {p.principal for p in self.event.acl_entries
                                 if p.has_management_permission('registration', explicit=True)}
        event_session_settings = session_settings.get_all(self.event)
        coordinator_privs = {name: event_session_settings[val] for name, val in COORDINATOR_PRIV_SETTINGS.iteritems()
                             if event_session_settings.get(val)}
        permissions = [[serialize_principal(p.principal), list(get_principal_permissions(p, Event))]
                       for p in self.event.acl_entries]
        permissions = [item for item in permissions if item[1]]

        return dict({'protection_mode': self.event.protection_mode, 'registration_managers': registration_managers,
                     'access_key': self.event.access_key, 'visibility': self.event.visibility,
                     'own_no_access_contact': self.event.own_no_access_contact, 'permissions': permissions},
                    **coordinator_privs)
Exemplo n.º 6
0
 def _process_GET(self):
     settings = session_settings.get_all(self.event_new)
     return jsonify(privs=[name for name, setting in COORDINATOR_PRIV_SETTINGS.iteritems() if settings[setting]])