Exemplo n.º 1
0
 def getPostableInfo(self, currentuser, memberable, fqpn):
     "gets postable only if you are member of the postable"
     postable = self.getPostable(currentuser, fqpn)
     # BUG:this should work for a user member of postable as well as a memberable member of postable
     # print "AUTHING", currentuser.nick, memberable.nick
     authorize_postable_member(MEMBER_OF_POSTABLE, self, currentuser, memberable, postable)
     # print "GOT HERE"
     owner = self.getUserForFqin(currentuser, postable.owner)
     creator = self.getUserForFqin(currentuser, postable.basic.creator)
     return postable, owner, creator
Exemplo n.º 2
0
 def membersOfPostable(self, currentuser, memberable, postable):
     "is user or memberable a member of the postable?"
     # i need to have access to this if i come in through being a member of a memberable which is a member
     # authorize_postable member takes care of this. That memberable is NOT the same memberable in the arguments here
     authorize_postable_member(False, self, currentuser, memberable, postable)
     # print "CU", currentuser.nick, memberable.nick
     if self.isOwnerOfPostable(currentuser, memberable, postable):
         # print "IS OWNER"
         perms = postable.get_member_rws()
     else:
         perms = postable.get_member_rws()
         for k in perms.keys():
             perms[k][1] = ""
     return perms