added rbac for viewing objects
diff --git a/planetstack/core/models/tag.py b/planetstack/core/models/tag.py
index cbe63a5..ef746da 100644
--- a/planetstack/core/models/tag.py
+++ b/planetstack/core/models/tag.py
@@ -22,3 +22,16 @@
def __unicode__(self):
return self.name
+
+ def can_update(self, user):
+ if user.is_admin:
+ return True
+ return False
+
+ def save_by_user(self, user, *args, **kwds):
+ if self.can_update(user):
+ super(Tag, self).save(*args, **kwds)
+
+ @staticmethod
+ def select_by_user(user):
+ return Tag.objects.all()