Comparison

util/sasl.lua @ 2241:ac3bd7c42c8b

util.sasl: Adding clean_clone() method.
author Tobias Markmann <tm@ayena.de>
date Thu, 26 Nov 2009 23:11:02 +0100
parent 2212:7cb6460b18d8
child 2254:f966c8699f5b
comparison
equal deleted inserted replaced
2231:288832cdec52 2241:ac3bd7c42c8b
88 s = setmetatable(sasl_i, method); 88 s = setmetatable(sasl_i, method);
89 s:forbidden(sasl_i, forbidden) 89 s:forbidden(sasl_i, forbidden)
90 return s; 90 return s;
91 end 91 end
92 92
93 -- get a fresh clone with the same realm, profiles and forbidden mechanisms
94 function method:clean_clone()
95 return new(self.realm, self.profile, self:forbidden())
96 end
97
93 -- set the forbidden mechanisms 98 -- set the forbidden mechanisms
94 function method:forbidden( restrict ) 99 function method:forbidden( restrict )
95 if restrict then 100 if restrict then
96 -- set forbidden 101 -- set forbidden
97 self.restrict = set.new(restrict); 102 self.restrict = set.new(restrict);