diff --git a/xos/core/models/user.py b/xos/core/models/user.py
index fc195d2..2ea90da 100644
--- a/xos/core/models/user.py
+++ b/xos/core/models/user.py
@@ -337,16 +337,20 @@
     def can_update_tenant_root_privilege(self, tenant_root_privilege, allow=[]):
         return self.can_update_tenant_root(tenant_root_privilege.tenant_root, allow)
 
-    def get_readable_objects(self, filter=None):
+    def get_readable_objects(self, filter_by=None):
        """ Returns a list of objects that the user is allowed to read. """
-       from core.models import Deployment, Network, Site, Slice, SliceTag, Sliver, Tag, User
-       models = [Deployment, Network, Site, Slice, SliceTag, Sliver, Tag, User]
+       from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Sliver, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
+       models = []
+       if filter_by and isinstance(filter_by, list):
+           models = [m for m in filter_by if issubclass(m, PlModelMixIn)]
+       if not models:
+           models = [Deployment, Network, Site, Slice, SliceTag, Sliver, Tag, User]
        readable_objects = []
        for model in models:
            readable_objects.extend(model.select_by_user(self))
        return readable_objects
 
-    def get_permissions(self, filter=None):
+    def get_permissions(self, filter_by=None):
         """ Return a list of objects for which the user has read or read/write 
         access. The object will be an instance of a django model object. 
         Permissions will be either 'r' or 'rw'.
@@ -358,9 +362,12 @@
           list of dicts  
        
         """
-        from core.models import *
+        from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Sliver, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege   
         READ = 'r'
         READWRITE = 'rw'
+        models = []
+        if filter_by and isinstance(filter_by, list):
+            models = [m for m in filter_by if issubclass(m, PlModelMixIn)]
 
         deployment_priv_objs = [Image, NetworkTemplate, Flavor]
         site_priv_objs = [Node, Slice, User]
@@ -389,6 +396,9 @@
         permissions = []
         permission_dict = lambda x,y: {'object': x, 'permission': y}
         for privilege_model, (model, affected_models) in privileg_map.items():
+            if models and model not in models:
+                continue
+
             # get the objects affected by this privilege model   
             affected_objects = []
             for affected_model in affected_models:
@@ -431,6 +441,11 @@
                                 
         return permissions                          
                      
+
+    def get_tenant_permissions(self):
+        from core.models import Site, Slice
+        return self.get_object_permissions(filter_by=[Site,Slice])
+
     
     @staticmethod
     def select_by_user(user):
