parsav  Diff

Differences From Artifact [7234d58b59]:

To Artifact [7c204f248d]:


   179    179   	body:send(self.con, code, [lib.mem.ptr(lib.http.header)] {
   180    180   		ptr = &hdrs[0], ct = [hdrs.type.N]
   181    181   	})
   182    182   
   183    183   	body.title:free()
   184    184   	body.body:free()
   185    185   end
          186  +
          187  +convo.methods.assertpow = macro(function(self, pow)
          188  +	return quote
          189  +		var ok = true
          190  +		if self.aid == 0 or self.who.rights.powers.[pow:asvalue()]() == false then
          191  +			ok = false
          192  +			self:complain(403,'insufficient privileges',['you lack the <strong>'..pow:asvalue()..'</strong> power and cannot perform this action'])
          193  +		end
          194  +	in ok end
          195  +end)
   186    196   
   187    197   struct convo.page {
   188    198   	title: pstring
   189    199   	body: pstring
   190    200   	class: pstring
   191    201   }
   192    202