mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Check out whether a virtual directory can be taken by a group or not
This commit is contained in:
parent
f1422651f2
commit
6be2cda9fb
@ -216,6 +216,21 @@ export class GroupsController {
|
||||
h.success("Group settings have been successfully updated!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the availability of a virtual directory for a given group
|
||||
*
|
||||
* @param h Request handler
|
||||
*/
|
||||
public static async CheckVirtualDirectory(h: RequestHandler) {
|
||||
const groupID = await h.postGroupIDWithAccess("groupID", GroupsAccessLevel.ADMIN_ACCESS);
|
||||
const virtualDirectory = h.postVirtualDirectory("directory");
|
||||
|
||||
if(!await checkVirtualDirectoryAvailability(virtualDirectory, groupID, VirtualDirType.GROUP))
|
||||
h.error(401, "The requested virtual directory seems not to be available!");
|
||||
|
||||
h.success("Requested virtual directory seems to be available!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a GroupInfo object into a valid API object
|
||||
*
|
||||
|
@ -98,4 +98,6 @@ export const Routes : Route[] = [
|
||||
{path: "/groups/get_settings", cb: (h) => GroupsController.GetSettings(h)},
|
||||
|
||||
{path: "/groups/set_settings", cb: (h) => GroupsController.SetSettings(h)},
|
||||
|
||||
{path: "/groups/checkVirtualDirectory", cb: (h) => GroupsController.CheckVirtualDirectory(h)},
|
||||
]
|
Loading…
Reference in New Issue
Block a user