def GetRoleUserIds(request):
    try:
        roleId = request.POST['roleId']
    except:
        roleId = None

    dtScope = RoleService.GetRoleUserIds(None, roleId)

    returnValue = StringHelper.GetSpitString(dtScope, ',')

    response = HttpResponse()
    response.content = returnValue
    return response
def GetUserRoleIds(request):
    try:
        userId = request.POST['userId']
    except:
        userId = None

    if userId:
        ids = UserRoleService.GetUserRoleIds(None, userId)
        returnValue = StringHelper.GetSpitString(ids, ',')
        response = HttpResponse()
        response.content = returnValue
        return response
    else:
        response = HttpResponse()
        response.content = ''
        return response
def GetPermissionItemsByUserId(request):
    try:
        userId = request.POST['userId']
    except:
        userId = None

    if userId:
        ids = UserPermission.GetUserPermissionItemIds(None, userId)
        returnValue = StringHelper.GetSpitString(ids, ',')
        response = HttpResponse()
        response.content = returnValue
        return response
    else:
        response = HttpResponse()
        response.content = ''
        return response
def GetPermissionItemsByRoleId(request):
    try:
        roleId = request.POST['roleId']
    except:
        roleId = None

    if roleId:
        ids = RolePermission.GetRolePermissionItemIds(None, roleId)
        returnValue = StringHelper.GetSpitString(ids, ',')
        response = HttpResponse()
        response.content = returnValue
        return response
    else:
        response = HttpResponse()
        response.content = ''
        return response
def GetModuleByUserId(request):
    try:
        userId = request.POST['userId']
    except:
        userId = None

    if userId:
        moduleIds = UserPermission.GetScopeModuleIdsByUserId(
            None, userId, "Resource.AccessPermission")
        returnValue = StringHelper.GetSpitString(moduleIds, ',')
        response = HttpResponse()
        response.content = returnValue
        return response
    else:
        response = HttpResponse()
        response.content = ''
        return response