예제 #1
0
 def contributors(self):
     return {
         int(k[len(self._contributor_prefix):], 36):
         ContributorPermissionSet.loads(v)
         for k, v in self._t.iteritems()
         if k.startswith(self._contributor_prefix)
     }
예제 #2
0
 def get(cls, event, user):
     try:
         row = cls._byID(event._id, properties=[user._id36])
         value = row[user._id36]
     except (tdb_cassandra.NotFound, KeyError):
         raise InviteNotFoundError
     return ContributorPermissionSet.loads(value)
예제 #3
0
 def get_all(cls, event):
     try:
         invites = cls._byID(event._id)._values()
     except tdb_cassandra.NotFound:
         return {}
     else:
         return {int(k, 36): ContributorPermissionSet.loads(v) for k, v in invites.iteritems()}
예제 #4
0
 def get(cls, event, user):
     try:
         row = cls._byID(event._id, properties=[user._id36])
         value = row[user._id36]
     except (tdb_cassandra.NotFound, KeyError):
         raise InviteNotFoundError
     return ContributorPermissionSet.loads(value)
 def get_all(cls, event):
     try:
         invites = cls._byID(event._id)._values()
     except tdb_cassandra.NotFound:
         return {}
     else:
         return {int(k, 36): ContributorPermissionSet.loads(v)
                 for k, v in invites.iteritems()}
예제 #6
0
 def get_permissions(self, user):
     permission_string = self._t.get(self._contributor_key(user), "")
     return ContributorPermissionSet.loads(permission_string)
예제 #7
0
 def contributors(self):
     return {
         int(k[len(self._contributor_prefix) :], 36): ContributorPermissionSet.loads(v)
         for k, v in self._t.iteritems()
         if k.startswith(self._contributor_prefix)
     }
예제 #8
0
 def get_permissions(self, user):
     permission_string = self._t.get(self._contributor_key(user), "")
     return ContributorPermissionSet.loads(permission_string)