<s> from . allows import _allows <EOL> class Permission ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * requirements , ** opts ) : <EOL> self . ext = _allows . _get_current_object ( ) <EOL> self . requirements = requirements <EOL> self . throws = opts . get ( '<STR_LIT>' , self . ext . throws ) <EOL> self . identity = opts . get ( '<STR_LIT>' ) <EOL> if isinstance ( self . throws , type ) : <EOL> self . throw_type = self . throws <EOL> else : <EOL> self . throw_type = type ( self . throws ) <EOL> def __bool__ ( self ) : <EOL> return self . ext . fulfill ( self . requirements , identity = self . identity ) <EOL> __nonzero__ = __bool__ <EOL> def __enter__ ( self ) : <EOL> if not self : <EOL> raise self . throws <EOL> def __exit__ ( self , exctype , value , tb ) : <EOL> pass </s>
