1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-04-28 10:33:20 +00:00
ccnet-server/lib/ccnet-rpc-wrapper.c

45 lines
1.2 KiB
C
Raw Normal View History

2016-08-18 09:39:55 +00:00
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include "include.h"
#include <ccnet.h>
#include <ccnet-object.h>
#include <searpc-client.h>
GList *
ccnet_get_groups_by_user (SearpcClient *client, const char *user, int return_ancestors)
2016-08-18 09:39:55 +00:00
{
if (!user)
return NULL;
return searpc_client_call__objlist (
client, "get_groups", CCNET_TYPE_GROUP, NULL,
2, "string", user, "int", return_ancestors);
2016-08-18 09:39:55 +00:00
}
2017-12-29 03:44:49 +00:00
GList *
ccnet_get_org_groups_by_user (SearpcClient *client, const char *user, int org_id)
{
if (!user)
return NULL;
return searpc_client_call__objlist (
client, "get_org_groups_by_user", CCNET_TYPE_GROUP, NULL,
2, "string", user, "int", org_id);
}
2016-08-18 09:39:55 +00:00
GList *
2020-10-14 06:33:57 +00:00
ccnet_get_group_members (SearpcClient *client, int group_id, int start, int limit)
2016-08-18 09:39:55 +00:00
{
return searpc_client_call__objlist (
client, "get_group_members", CCNET_TYPE_GROUP_USER, NULL,
2020-10-14 06:33:57 +00:00
3, "int", group_id, "int", start, "int", limit);
2016-08-18 09:39:55 +00:00
}
int
ccnet_org_user_exists (SearpcClient *client, int org_id, const char *user)
{
return searpc_client_call__int (client, "org_user_exists", NULL,
2, "int", org_id, "string", user);
}