Example #1
0
 def permissions_info(self):
     permissions, tree, default = get_permissions_info(Track)
     return {
         'permissions': permissions,
         'tree': tree['_full_access']['children'],
         'default': default
     }
Example #2
0
 def _process(self):
     principal = json.loads(request.form['principal'])
     permissions_tree = get_permissions_info(Event)[1]
     return jsonify_template(
         'events/management/event_permissions_dialog.html',
         permissions_tree=permissions_tree,
         permissions=request.form.getlist('permissions'),
         principal=principal)
Example #3
0
 def _process(self):
     principal = json.loads(request.form['principal'])
     permissions_tree = get_permissions_info(
         PermissionsField.type_mapping[request.view_args['type']])[1]
     return jsonify_template(
         'events/management/permissions_dialog.html',
         permissions_tree=permissions_tree,
         permissions=request.form.getlist('permissions'),
         principal=principal)
Example #4
0
 def hidden_permissions_info(self):
     all_permissions = get_available_permissions(
         PermissionsField.type_mapping[self.object_type])
     visible_permissions = get_permissions_info(
         PermissionsField.type_mapping[self.object_type])[0]
     return {
         k: all_permissions[k].friendly_name
         for k in set(all_permissions) - set(visible_permissions)
     }
Example #5
0
 def _get_principal_permissions(self, principal):
     """Retrieve a set containing the valid permissions of a principal."""
     permissions = set()
     if principal.full_access:
         permissions.add(FULL_ACCESS_PERMISSION)
     if principal.read_access:
         permissions.add(READ_ACCESS_PERMISSION)
     available_permissions = get_permissions_info(Event)[0]
     return permissions | (set(principal.permissions)
                           & set(available_permissions))
Example #6
0
 def __init__(self, *args, **kwargs):
     super(PermissionsField, self).__init__(*args, **kwargs)
     self.ip_networks = map(serialize_ip_network_group, IPNetworkGroup.query.filter_by(hidden=False))
     self.permissions_info = get_permissions_info(Event)[0]
 def _process(self):
     permissions, tree, default = get_permissions_info(Room)
     return jsonify(permissions=permissions, tree=tree, default=default)
Example #8
0
 def permissions_info(self):
     return get_permissions_info(PermissionsField.type_mapping[self.object_type])[0]
Example #9
0
 def permissions_info(self):
     return get_permissions_info(PermissionsField.type_mapping[self.object_type])[0]
Example #10
0
 def _process(self):
     principal = json.loads(request.form['principal'])
     permissions_tree = get_permissions_info(PermissionsField.type_mapping[request.view_args['type']])[1]
     return jsonify_template('events/management/permissions_dialog.html', permissions_tree=permissions_tree,
                             permissions=request.form.getlist('permissions'), principal=principal)