     'outcast', 'none', 'member',
     'publisher', 'moderator', 'owner'
 ]
+isAffiliationAtLeast = (affiliation1, affiliation2) ->
+    AFFILIATIONS.indexOf(affiliation1) >= AFFILIATIONS.indexOf(affiliation2)
+
 class PrivilegedOperation extends ModelOperation
 
     transaction: (t, cb) ->


                @actorAffiliation = 'none'
                for affiliation in affiliations
                    if AFFILIATIONS.indexOf(affiliation) > AFFILIATIONS.indexOf(@actorAffiliation)
                        @actorAffiliation = affiliation
                cb()


            when 'open'
                pass = true
            when 'members'
                pass = isAffiliationAtLeast @actorAffiliation, 'member'
            when 'publishers'
                pass = isAffiliationAtLeast @actorAffiliation, 'publishers'
            else
                # Owners can always post
                pass = (@actorAffiliation is 'owner')
