- Change .py files to use 4-space indents and no hard tab characters.
[plcapi.git] / PLC / Methods / DeleteInterfaceTag.py
index 82da0dc..67b2bbb 100644 (file)
@@ -1,4 +1,5 @@
-# $Id#
+# $Id$
+# $URL$
 #
 # Thierry Parmentelat - INRIA
 #
@@ -53,22 +54,22 @@ class DeleteInterfaceTag(Method):
 
         assert interface_tag['interface_tag_id'] in interface['interface_tag_ids']
 
-       # 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']
-           
-           required_min_role = tag_type ['min_role_id']
-           if required_min_role is not None and \
-                   min(self.caller['role_ids']) > required_min_role:
-               raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
+        # 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']
+
+            required_min_role = tag_type ['min_role_id']
+            if required_min_role is not None and \
+                    min(self.caller['role_ids']) > required_min_role:
+                raise PLCPermissionDenied, "Not allowed to modify the specified interface setting, requires role %d",required_min_role
 
         interface_tag.delete()
-       self.object_ids = [interface_tag['interface_tag_id']]
+        self.object_ids = [interface_tag['interface_tag_id']]
 
         return 1