-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '137750-support-input-pkgs' of github.com:hop-dev/kibana…
… into 137750-support-input-pkgs
- Loading branch information
Showing
148 changed files
with
5,973 additions
and
1,356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
x-pack/plugins/cases/common/api/cases/suggest_user_profiles.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*/ | ||
|
||
export * from './test_providers'; | ||
export * from './permissions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { CasesCapabilities, CasesPermissions } from '../../containers/types'; | ||
|
||
export const allCasesPermissions = () => buildCasesPermissions(); | ||
export const noCasesPermissions = () => | ||
buildCasesPermissions({ read: false, create: false, update: false, delete: false, push: false }); | ||
export const readCasesPermissions = () => | ||
buildCasesPermissions({ read: true, create: false, update: false, delete: false, push: false }); | ||
export const noCreateCasesPermissions = () => buildCasesPermissions({ create: false }); | ||
export const noUpdateCasesPermissions = () => buildCasesPermissions({ update: false }); | ||
export const noPushCasesPermissions = () => buildCasesPermissions({ push: false }); | ||
export const noDeleteCasesPermissions = () => buildCasesPermissions({ delete: false }); | ||
export const writeCasesPermissions = () => buildCasesPermissions({ read: false }); | ||
|
||
export const buildCasesPermissions = (overrides: Partial<Omit<CasesPermissions, 'all'>> = {}) => { | ||
const create = overrides.create ?? true; | ||
const read = overrides.read ?? true; | ||
const update = overrides.update ?? true; | ||
const deletePermissions = overrides.delete ?? true; | ||
const push = overrides.push ?? true; | ||
const all = create && read && update && deletePermissions && push; | ||
|
||
return { | ||
all, | ||
create, | ||
read, | ||
update, | ||
delete: deletePermissions, | ||
push, | ||
}; | ||
}; | ||
|
||
export const allCasesCapabilities = () => buildCasesCapabilities(); | ||
export const noCasesCapabilities = () => | ||
buildCasesCapabilities({ | ||
create_cases: false, | ||
read_cases: false, | ||
update_cases: false, | ||
delete_cases: false, | ||
push_cases: false, | ||
}); | ||
export const readCasesCapabilities = () => | ||
buildCasesCapabilities({ | ||
create_cases: false, | ||
update_cases: false, | ||
delete_cases: false, | ||
push_cases: false, | ||
}); | ||
export const writeCasesCapabilities = () => { | ||
return buildCasesCapabilities({ | ||
read_cases: false, | ||
}); | ||
}; | ||
|
||
export const buildCasesCapabilities = (overrides?: Partial<CasesCapabilities>) => { | ||
return { | ||
create_cases: overrides?.create_cases ?? true, | ||
read_cases: overrides?.read_cases ?? true, | ||
update_cases: overrides?.update_cases ?? true, | ||
delete_cases: overrides?.delete_cases ?? true, | ||
push_cases: overrides?.push_cases ?? true, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.