Differences From
Artifact [4fbd6ed0a5]:
129 129 else
130 130 ::wrongmeth:: co:complain(405, 'method not allowed', 'that method is not meaningful for this endpoint') do return end
131 131 end
132 132 return
133 133 end
134 134
135 135 terra http.post_compose(co: &lib.srv.convo, meth: method.t)
136 + if not co:assertpow('post') then return end
137 + --if co.who.rights.powers.post() == false then
138 + --co:complain(403,'insufficient privileges','you lack the <strong>post</strong> power and cannot perform this action')
139 +
136 140 if meth == method.get then
137 141 lib.render.compose(co, nil)
138 142 elseif meth == method.post then
139 - if co.who.rights.powers.post() == false then
140 - co:complain(401,'insufficient privileges','you lack the <strong>post</strong> power and cannot perform this action') return
141 - end
142 143 var text, textlen = co:postv("post")
143 144 var acl, acllen = co:postv("acl")
144 145 var subj, subjlen = co:postv("subject")
145 146 if text == nil or acl == nil then
146 147 co:complain(405, 'invalid post', 'every post must have at least body text and an ACL')
147 148 return
148 149 end