code: def permissions(self):
          
          perms = set()
          for g in self.groups:
              perms = perms | set(g.permissions)
          return perms
docs: Return a set with all permissions granted to the user.