Updated rights so that each GENI AM call has a specific right associated with it.
[sfa.git] / sfa / methods / SliverStatus.py
index 6b90096..24d6ff2 100644 (file)
@@ -2,7 +2,6 @@ from sfa.util.faults import *
 from sfa.util.namespace import *
 from sfa.util.method import Method
 from sfa.util.parameter import Parameter
-from sfa.server.aggregate import Aggregates
 
 class SliverStatus(Method):
     """
@@ -20,10 +19,7 @@ class SliverStatus(Method):
     def call(self, slice_xrn, creds):
         hrn, type = urn_to_hrn(slice_xrn)
         
-        # Make sure that this is a geni_aggregate talking to us
-        geni_aggs = Aggregates(self.api, '/etc/sfa/geni_aggregates.xml')
-        if not hrn in [agg['hrn'] for agg in geni_aggs]:
-            raise SfaPermissionDenied("Only GENI Aggregates may make this call")
+        ValidCreds = self.api.auth.checkCredentials(creds, 'sliverstatus', hrn)
 
         self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, hrn, self.name))
 
@@ -33,7 +29,7 @@ class SliverStatus(Method):
             mgr_type = self.api.config.SFA_GENI_AGGREGATE_TYPE
             manager_module = manager_base + ".geni_am_%s" % mgr_type
             manager = __import__(manager_module, fromlist=[manager_base])
-            return manager.SliverStatus(self.api, slice_xrn)
+            return manager.SliverStatus(self.api, slice_xrn, ValidCreds)
 
         return ''