- # check permission : it not admin, is the user affiliated with the right site
- if 'admin' not in self.caller['roles']:
- # locate node
- node = Nodes (self.api,[interface['node_id']])[0]
- # locate site
- site = Sites (self.api, [node['site_id']])[0]
- # check caller is affiliated with this site
- if self.caller['person_id'] not in site['person_ids']:
- raise PLCPermissionDenied, "Not a member of the hosting site %s"%site['abbreviated_site']
+ interfaces = Interfaces (self.api, interface_tag['interface_id'])
+ if not interfaces:
+ raise PLCInvalidArgument, "No such interface %d"%interface_tag['interface_id']
+ interface=interfaces[0]