mirror of
https://github.com/solero/houdini.git
synced 2024-12-22 13:33:39 +00:00
Implement converter for houdini.data.permission.Permission
This commit is contained in:
parent
38e4a1e0fa
commit
fbe8ba5eb2
@ -348,6 +348,17 @@ class PenguinPuffleConverter(IConverter):
|
||||
return None
|
||||
|
||||
|
||||
class PermissionConverter(IConverter):
|
||||
|
||||
description = """Converts a permission identifier to a houdini.data.Permission instance"""
|
||||
|
||||
async def convert(self, ctx):
|
||||
try:
|
||||
return ctx.p.server.permissions[ctx.argument]
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
|
||||
class SeparatorConverter(IConverter):
|
||||
|
||||
__slots__ = ['separator', 'mapper']
|
||||
@ -442,7 +453,9 @@ ConverterTypes = {
|
||||
Stamp: StampConverter,
|
||||
Puffle: PuffleConverter,
|
||||
|
||||
PenguinPuffle: PenguinPuffleConverter
|
||||
PenguinPuffle: PenguinPuffleConverter,
|
||||
|
||||
Permission: PermissionConverter
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user