Interface GroupResource
@Path("/group")
public interface GroupResource
Resource to get groups
-
Method Summary
Modifier and TypeMethodDescriptionCreate subgroupAdd existing user to the given groupcreateUser(String id, User user) Create user in the given groupjakarta.ws.rs.core.ResponseDelete a groupLoad group with given IDgetInstancePerms(String id, String type, Integer instanceId) Get instance permissions for a groupGet permissions set for a group.getTypePerms(String id, String type) Get type permissions for a grouplist(FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, PermsParameterBean perms) List groups.
The result can be filtered byidnamedescriptionand sorted byidnamedescriptionlist(Integer skipCount, Integer maxItems, List<Integer> ids, List<String> names, List<String> memberLogins, List<Integer> memberIds, List<Integer> childGroupIds, List<Integer> privFolderIds, List<Privilege> privileges, GroupReduceType reduce, GroupSortAttribute sortBy, SortOrder sortOrder, PermsParameterBean perms) Deprecated.because new endpoint exists.load(PermsParameterBean perms) Load the groups the user may seeMove subgroupjakarta.ws.rs.core.ResponseremoveUser(String id, String userId) Remove user from a groupsetInstancePerms(String id, String type, Integer instanceId, long waitMs, TypePermissionRequest request) Set instance permissions for a groupsetTypePerms(String id, String type, long waitMs, TypePermissionRequest request) Set type permissions for a groupsubgroups(String id, FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, PermsParameterBean perms) List subgroups of the given group.
The result can be filtered byidnamedescriptionand sorted byidnamedescriptionUpdate a groupusers(String id, FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, PermsParameterBean perms, EmbedParameterBean embed) List users of given group.
The result can be filtered byidloginfirstNamelastNameemailand sorted byidloginfirstNamelastNameemail
-
Method Details
-
load
Load the groups the user may see- Parameters:
perms- permissions parameters- Returns:
- response containing groups
-
list
@GET @Path("/list") @Deprecated GroupsResponse list(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("id") List<Integer> ids, @QueryParam("name") List<String> names, @QueryParam("memberlogin") List<String> memberLogins, @QueryParam("memberid") List<Integer> memberIds, @QueryParam("children") List<Integer> childGroupIds, @QueryParam("folder") List<Integer> privFolderIds, @QueryParam("privileges") List<Privilege> privileges, @QueryParam("reduce") GroupReduceType reduce, @QueryParam("sortby") GroupSortAttribute sortBy, @QueryParam("sortorder") @DefaultValue("asc") SortOrder sortOrder, @BeanParam PermsParameterBean perms) Deprecated.because new endpoint exists. uselist(FilterParameterBean, SortParameterBean, PagingParameterBean, PermsParameterBean)insteadGet a list of groups, optionally filtered sorted and paged.- Parameters:
skipCount- number of groups skipped in the list (paging)maxItems- maximum number of groups returned (paging)ids- id of the group to return (filter)names- name or name pattern of the group(s) to return (filter)memberLogins- login name of the group member for the group(s) to return (filter)memberIds- id of the group member for the group(s) to return (filter)childGroupIds- ids of child groups for the group(s) to return (filter)privFolderIds- ids of folders for filtering by folder permissions (together with "privileges")privileges- list of privileges for filtering by folder permissions (together with "folder")reduce- if set, the list of groups will be reduced: for nested groups, only parent group(s) or child group(s) will be returnedsortBy- name of the sorted attribute (sorting)sortOrder- sortorder (sorting)perms- permissions parameters- Returns:
- response containing the groups
-
list
@GET GroupList list(@BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms) throws Exception List groups.
The result can be filtered byidnamedescription
idnamedescription
- Parameters:
filter- filter parameterssorting- sorting parameterspaging- paging parametersperms- permissions parameters- Returns:
- list of groups
- Throws:
Exception
-
get
Load group with given ID- Parameters:
id- local group ID- Returns:
- group response
- Throws:
Exception
-
subgroups
@GET @Path("/{id}/groups") GroupList subgroups(@PathParam("id") String id, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms) throws Exception List subgroups of the given group.
The result can be filtered byidnamedescription
idnamedescription
- Parameters:
id- local group IDfilter- filter parameterssorting- sorting parameterspaging- paging parametersperms- permissions parameters- Returns:
- list of subgroups
- Throws:
Exception
-
add
@PUT @Path("/{id}/groups") GroupLoadResponse add(@PathParam("id") String id, Group group) throws Exception Create subgroup- Parameters:
id- local group IDgroup- group- Returns:
- created group
- Throws:
Exception
-
move
@PUT @Path("/{id}/groups/{subgroupId}") GroupLoadResponse move(@PathParam("id") String id, @PathParam("subgroupId") String subgroupId) throws Exception Move subgroup- Parameters:
id- local mother group IDgroup- group- Returns:
- created group
- Throws:
Exception
-
delete
@DELETE @Path("/{id}") jakarta.ws.rs.core.Response delete(@PathParam("id") String id) throws Exception Delete a group- Parameters:
id- local group ID- Returns:
- empty response
- Throws:
Exception
-
update
@POST @Path("/{id}") GroupLoadResponse update(@PathParam("id") String id, Group group) throws Exception Update a group- Parameters:
id- local group IDgroup- new group data- Returns:
- updated group
- Throws:
Exception
-
users
@GET @Path("/{id}/users") UserList users(@PathParam("id") String id, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms, @BeanParam EmbedParameterBean embed) throws Exception List users of given group.
The result can be filtered byidloginfirstNamelastNameemail
idloginfirstNamelastNameemail
- Parameters:
id- local group IDfilter- filter parameterssorting- sorting parameterspaging- paging parametersperms- permissions parametersembed- optionally embed the referenced objects (group)- Returns:
- list of group members
- Throws:
Exception
-
createUser
@PUT @Path("/{id}/users") UserLoadResponse createUser(@PathParam("id") String id, User user) throws Exception Create user in the given group- Parameters:
id- local group IDuser- user to create- Returns:
- created user
- Throws:
Exception
-
addUser
@PUT @Path("/{id}/users/{userId}") UserLoadResponse addUser(@PathParam("id") String id, @PathParam("userId") String userId) throws Exception Add existing user to the given group- Parameters:
id- local group IDuserId- local user ID- Returns:
- user
- Throws:
Exception
-
removeUser
@DELETE @Path("/{id}/users/{userId}") jakarta.ws.rs.core.Response removeUser(@PathParam("id") String id, @PathParam("userId") String userId) throws Exception Remove user from a group- Parameters:
id- local group IDuserId- local user ID- Returns:
- empty response
- Throws:
Exception
-
getPerms
@GET @Path("/{id}/perms") TypePermissionList getPerms(@PathParam("id") String id, @QueryParam("parentType") String parentType, @QueryParam("parentId") Integer parentId, @QueryParam("channelId") Integer channelId) throws Exception Get permissions set for a group. If no parentType is given, only root-level permissions will be returned. Otherwise, the permissions on child types/instances of the given parentType/parentId will be returned.- Parameters:
id- group IDparentType- optional parent typeparentId- optional parent IDchannelId- optional channel ID- Returns:
- Permissions response
- Throws:
Exception
-
getTypePerms
@GET @Path("/{id}/perms/{type}") TypePermissionResponse getTypePerms(@PathParam("id") String id, @PathParam("type") String type) throws Exception Get type permissions for a group- Parameters:
id- group IDtype- type- Returns:
- Permissions response
- Throws:
Exception
-
setTypePerms
@POST @Path("/{id}/perms/{type}") GenericResponse setTypePerms(@PathParam("id") String id, @PathParam("type") String type, @QueryParam("wait") @DefaultValue("0") long waitMs, TypePermissionRequest request) throws Exception Set type permissions for a group- Parameters:
id- group IDtype- typewaitMs- wait timeout in millisecondsrequest- request- Returns:
- response
- Throws:
Exception
-
getInstancePerms
@GET @Path("/{id}/perms/{type}/{instanceId}") TypePermissionResponse getInstancePerms(@PathParam("id") String id, @PathParam("type") String type, @PathParam("instanceId") Integer instanceId) throws Exception Get instance permissions for a group- Parameters:
id- group IDtype- typeinstanceId- instance ID- Returns:
- Permissions response
- Throws:
Exception
-
setInstancePerms
@POST @Path("/{id}/perms/{type}/{instanceId}") GenericResponse setInstancePerms(@PathParam("id") String id, @PathParam("type") String type, @PathParam("instanceId") Integer instanceId, @QueryParam("wait") @DefaultValue("0") long waitMs, TypePermissionRequest request) throws Exception Set instance permissions for a group- Parameters:
id- group IDtype- typeinstanceId- instance IDwaitMs- wait timeout in millisecondsrequest- request- Returns:
- response
- Throws:
Exception
-