now passing the kind for share object by key in order to be able to share things to ther objects and not just users/teams

This commit is contained in:
csawatzky 2026-03-27 14:35:02 -06:00
parent 777089e8c4
commit 8633c197ab
2 changed files with 7 additions and 4 deletions

View file

@ -25,6 +25,7 @@ export interface IPermissionAPIContext {
shareObjectByKey: (
scope: Scope,
key: string,
kind: string,
permissions: pond.Permission[],
keys?: string[],
type?: string[]
@ -138,7 +139,7 @@ export default function PermissionProvider(props: PropsWithChildren<Props>) {
})
};
const shareObjectByKey = (scope: Scope, key: string, permissions: pond.Permission[], keys?: string[], types?: string[]) => {
const shareObjectByKey = (scope: Scope, key: string, kind: string, permissions: pond.Permission[], keys?: string[], types?: string[]) => {
let url = pondURL("/" + scope.kind + "s/" + scope.key + "/shareByKey") + (keys ? "?keys=" + keys.join(",") : "") +
(types ? "&types=" + types.join(",") : "")
if (as) url = pondURL(`/${scope.kind}s/${scope.key}/shareByKey?as=${as}`) + (keys ? "&keys=" + keys.join(",") : "") +
@ -146,6 +147,7 @@ export default function PermissionProvider(props: PropsWithChildren<Props>) {
return new Promise<AxiosResponse>((resolve, reject) => {
post(url, {
key: key,
kind: kind,
permissions: permissions.map(permission => permissionToString(permission))
}).then(resp => {
return resolve(resp)