def readByUserAndGroup(cls, userId, groupId): db = core.connect() return core.object(Permission.by_user_and_group(db, key=[userId, groupId]))
def readByName(cls, userName): return core.object(SSUser.by_name(core.connect(), key=userName))
def readByShortName(cls, shortName): db = core.connect() return core.object(Group.by_short_name(db, key=shortName))
def readByLongName(cls, longName): db = core.connect() return core.object(Group.by_long_name(db, key=longName))
def dbShortName(cls, shortName, absolute=False): result = core.object(Group.by_short_name(core.connect(), key=shortName)) if result: return "%s/group/%s" % ((result.source.server or ""), result.id)
def dbLongName(cls, longName, absolute=False): result = core.object(Group.by_long_name(core.connect(), key=longName)) if result: return "%s/group/%s" % ((result.source.server or ""), result.id)
def dbLongName(cls, longName, absolute=False): result = core.object(Group.by_long_name(core.connect(), key=longName)) if result: return "%s/group/%s" % ((result.source.server or ''), result.id)
def dbShortName(cls, shortName, absolute=False): result = core.object(Group.by_short_name(core.connect(), key=shortName)) if result: return "%s/group/%s" % ((result.source.server or ''), result.id)
def readByUserAndGroup(cls, userId, groupId): db = core.connect() return core.object( Permission.by_user_and_group(db, key=[userId, groupId]))