Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
7730412
New Security Management page: View Space
tsullivan May 24, 2024
827c2b0
Content counts link to saved objects page
tsullivan Jun 3, 2024
3062995
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 4, 2024
a3af1d8
link to content working
tsullivan Jun 4, 2024
8261854
Polish features tab
tsullivan Jun 4, 2024
250b983
Loading states
tsullivan Jun 4, 2024
90862b1
minor copy update to features tab
tsullivan Jun 4, 2024
08b197e
use encodeURIComponent in params of href when navigating to content
tsullivan Jun 5, 2024
b75b6ae
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 6, 2024
bb657e9
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 7, 2024
e433101
[wip] callout for current space
tsullivan Jun 7, 2024
509479f
Feature table: optional header text
tsullivan Jun 7, 2024
2cacaa3
Feature table: dynamic “show all” / “hide all”
tsullivan Jun 7, 2024
59ac384
Enabled Features tab header text update
tsullivan Jun 7, 2024
1c49338
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 7, 2024
e968986
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 7, 2024
6121659
display switch to space only when space is not active space
eokoneyo Jun 3, 2024
7f90e7f
swap hardcoded strings for translated ones
eokoneyo Jun 4, 2024
35a37e9
add ftr test for space details and space switching
eokoneyo Jun 4, 2024
83f5dad
fix failing test
eokoneyo Jun 10, 2024
dd25dd2
add switch to space icon on space list table
eokoneyo Jun 13, 2024
eb6497b
visual tweak for role creation page
eokoneyo Jun 13, 2024
31635b7
start work on assign to role flyout
eokoneyo Jun 13, 2024
e844219
Merge pull request #11 from eokoneyo/tsullivan-roles-spaces-modal
tsullivan Jun 17, 2024
d3cf527
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 17, 2024
c165690
fix i18n
tsullivan Jun 17, 2024
a0e4b4b
fix ts
tsullivan Jun 17, 2024
d926a01
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 19, 2024
b711c46
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 21, 2024
d3d6eec
Truncate description in spaces grid page
tsullivan Jun 21, 2024
3b9b113
Use subdued badge color in tabs
tsullivan Jun 21, 2024
7639092
Update spaces grid for multiple actions
tsullivan Jun 21, 2024
581b59f
Keep user on spaces grid page when they switch to space from there
tsullivan Jun 21, 2024
bc79e01
fix i18n error
tsullivan Jun 21, 2024
3afa207
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jun 21, 2024
6a64fa6
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 1, 2024
e7ae2f2
add fixme props
tsullivan Jul 1, 2024
532a0cc
fix ts
tsullivan Jul 1, 2024
7079146
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 1, 2024
4341bf2
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 3, 2024
c7ea1bb
Current space badge for space detail header
tsullivan Jul 3, 2024
ac40e06
Show selected solution in space detail
tsullivan Jul 3, 2024
fed1c85
Cleanup
tsullivan Jul 3, 2024
5b89ead
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 8, 2024
2a16ec9
Minor feedback updates
tsullivan Jul 8, 2024
19dd7ff
Make action icons for the space consistent
tsullivan Jul 8, 2024
6e00210
include roleAPIClient
eokoneyo Jul 2, 2024
fa0a086
conditionally render role action based on user capabilities
eokoneyo Jul 2, 2024
fbfa5c2
start on assigning space to selected roles
eokoneyo Jul 2, 2024
b92d1e5
switch to leveraging predefined privilege
eokoneyo Jul 3, 2024
e5f24ac
Design feedback
eokoneyo Jul 9, 2024
825be30
Merge pull request #13 from eokoneyo/feat/assigning-roles-to-space
tsullivan Jul 9, 2024
26f20e3
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 9, 2024
2505f3d
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 12, 2024
07b4e5b
fix jest test
tsullivan Jul 12, 2024
12995c1
fix fn test
tsullivan Jul 12, 2024
16eb2a6
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 16, 2024
43dc4f8
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 17, 2024
5f851b3
File rename
tsullivan Jul 17, 2024
0d227e5
Replace Omit with Pick
tsullivan Jul 18, 2024
879832e
Add General tab
tsullivan Jul 18, 2024
af8121b
Add Solution View to features tab
tsullivan Jul 18, 2024
ce101fc
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 18, 2024
83c0a91
fix solution view in features tab
tsullivan Jul 18, 2024
b9c8ff0
Clean up args
tsullivan Jul 18, 2024
17a66ef
Avoid `useKibana`
tsullivan Jul 18, 2024
5243f1b
Wip - make editable
tsullivan Jul 18, 2024
bf244d4
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 22, 2024
278dee4
Fix ts in Roles
tsullivan Jul 22, 2024
5e064f7
Unsaved changes prompt
tsullivan Jul 22, 2024
1cc5125
quick checks and consistency
tsullivan Jul 22, 2024
79afa3a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jul 22, 2024
fb221eb
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 23, 2024
9666bd4
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 24, 2024
0f2c78c
Optional title for SectionPanel to lessen headers for View Space tabs
tsullivan Jul 24, 2024
dbdbaa5
Handle allowFeatureVisibility
tsullivan Jul 24, 2024
cc06372
Implement save space features and space settings
tsullivan Jul 25, 2024
95a54ac
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 26, 2024
99802b0
Use new UI for Edit link
tsullivan Jul 26, 2024
cae0793
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 29, 2024
abddade
--wip-- [skip ci]
tsullivan Jul 29, 2024
e7a2c96
Footer controls
tsullivan Jul 30, 2024
e4dbc1e
Merge branch 'main' into roles/details/spaces-modal
tsullivan Jul 30, 2024
aa27b32
Remove Settings button
tsullivan Jul 30, 2024
b8b1b52
wip: assign roles from create form
tsullivan Jul 30, 2024
0977eb7
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 1, 2024
d7f96e0
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 2, 2024
1269674
fix unit test
tsullivan Aug 2, 2024
0f3d01b
Remove features column from table for non-classic
tsullivan Aug 2, 2024
adaea5f
Move features table to settings tab for non-classic
tsullivan Aug 2, 2024
2d4ec56
fix unit test
tsullivan Aug 2, 2024
67146fb
show space badge if non-classic
tsullivan Aug 2, 2024
3f81a07
Merge branch 'roles/details/spaces-modal' of github.com:tsullivan/kib…
tsullivan Aug 2, 2024
54028cf
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 5, 2024
1211142
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 5, 2024
e53ce6d
fix functional test
tsullivan Aug 5, 2024
ad8c702
wip fix functional tests for new tab design
tsullivan Aug 5, 2024
2465325
wip fix functional tests for new tab design
tsullivan Aug 5, 2024
60d79cf
update user impact warning
tsullivan Aug 5, 2024
02d82f1
Merge branch 'roles/details/spaces-modal' of github.com:tsullivan/kib…
tsullivan Aug 5, 2024
f3224c8
Fix edit space confirm modals
tsullivan Aug 5, 2024
4d013a4
Fix functional tests
tsullivan Aug 5, 2024
78a07e5
skip failing tests
tsullivan Aug 6, 2024
c9eebea
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 6, 2024
801a52c
Fix update avatar initials
tsullivan Aug 6, 2024
2c70b05
Apply notifications when save or cancel
tsullivan Aug 6, 2024
f2cae83
fix font size for "No features visible"
tsullivan Aug 6, 2024
80d4188
handle error when user has no privilege to view roles
tsullivan Aug 6, 2024
22b9840
fix fn tests
tsullivan Aug 6, 2024
c19c560
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 9, 2024
fbec082
Clean up unused prop
tsullivan Aug 9, 2024
d3abbe1
Remove stray WIP
tsullivan Aug 9, 2024
04f1cb5
lazy load tab content
tsullivan Aug 9, 2024
e732902
Fix delete space
tsullivan Aug 9, 2024
0fd7a06
consolidate ftr tests for listing of spaces
tsullivan Aug 9, 2024
2ebb3f6
start ftr test for create space
tsullivan Aug 10, 2024
ccddaaf
Test for editing space initials
tsullivan Aug 14, 2024
5a71687
functional tests cleanup
tsullivan Aug 15, 2024
f2d6da4
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 15, 2024
eb4a5f5
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 15, 2024
24c014b
fix i18n check
tsullivan Aug 16, 2024
d7f9a71
Show/hide feature visibility picker
tsullivan Aug 16, 2024
31149f3
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 19, 2024
2cb78c7
Correction for solution visibility / feature visibility
tsullivan Aug 19, 2024
ec6b2f9
fix tests
tsullivan Aug 19, 2024
454e357
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 20, 2024
5f82465
Memoize functions that are passed as props to child components
tsullivan Aug 21, 2024
73bf1b6
todos
tsullivan Aug 22, 2024
8d4838a
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 22, 2024
c53c6d5
Unit test for General Settings tab
tsullivan Aug 22, 2024
273fdc8
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 23, 2024
24034b3
Update comments
tsullivan Aug 23, 2024
986e8f5
More unit test for General Settings tab
tsullivan Aug 23, 2024
8052507
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 26, 2024
19a81bc
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 26, 2024
f69154e
Merge branch 'main' into roles/details/spaces-modal
elasticmachine Aug 27, 2024
1bf9623
Merge branch 'roles/details/spaces-modal' of github.com:tsullivan/kib…
tsullivan Aug 27, 2024
3f4c279
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 27, 2024
ae18346
[Spaces] Manage Space: features picker is shown only when solution is…
tsullivan Aug 27, 2024
2338e06
create spaces assigned role table
eokoneyo Jul 23, 2024
8872a5d
extend definition of roles that can be edited
eokoneyo Jul 26, 2024
bb69ad5
fix pluralization in select all button
eokoneyo Jul 26, 2024
73a0dd1
slight adjustments rendered items count
eokoneyo Jul 26, 2024
88a2c2d
fix text, and hide assign to space button when there are roles to assign
eokoneyo Jul 31, 2024
4b76e01
integrate security packages
eokoneyo Aug 1, 2024
9cbf1ec
add tests for provisioning privilege API client
eokoneyo Aug 2, 2024
8f2f38d
even more UI improvements
eokoneyo Aug 12, 2024
1bc6528
refactor trigger for flyout and integrate it with bulk actions
eokoneyo Aug 13, 2024
63035a7
make accomodation for edit existing record
eokoneyo Aug 13, 2024
9541fc4
integrate API to update roles, leverage this to update existing space…
eokoneyo Aug 13, 2024
ee5e218
add logic to handle removing roles from space
eokoneyo Aug 14, 2024
c13613e
refactor implementation to provide visual feedback on UI actions
eokoneyo Aug 15, 2024
a50eade
fix logic for excluding roles already ppart of space
eokoneyo Aug 15, 2024
ad1e526
fix logic with selectable items
eokoneyo Aug 15, 2024
f51800b
add implementation for assigning custom roles privileges
eokoneyo Aug 15, 2024
8be8076
refactor logic for selecting role cutomization anchor
eokoneyo Aug 19, 2024
e91dff4
UI cleanup
eokoneyo Aug 21, 2024
1b7d516
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 23, 2024
7f5cff9
fix failing tests
eokoneyo Aug 26, 2024
27b1428
UI tweaks
eokoneyo Aug 26, 2024
3fb9d8e
add tests for view space provider
eokoneyo Aug 26, 2024
f18eba3
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Aug 27, 2024
d29d066
add tests for space assign role privilege form
eokoneyo Aug 26, 2024
7579ac5
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Aug 27, 2024
18c0d83
pass appropriate types to component
eokoneyo Aug 27, 2024
ccd34f3
Merge pull request #14 from eokoneyo/assign-roles-to-space
tsullivan Aug 28, 2024
1eaa880
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 28, 2024
699088d
remove the EuiText that surrounds the view-space-page
tsullivan Aug 28, 2024
70fb39f
--wip-- [skip ci]
tsullivan Aug 29, 2024
9a8320d
Merge branch 'main' into roles/details/spaces-modal
tsullivan Aug 29, 2024
cfb7972
fix ts
tsullivan Aug 29, 2024
467bea8
file/folder reorg
tsullivan Aug 29, 2024
acae0c5
file/folder reorg
tsullivan Aug 29, 2024
38a85b0
Merge branch 'roles/details/spaces-modal' of github.com:tsullivan/kib…
tsullivan Aug 30, 2024
0f084bf
update delete spaces button snapshot
eokoneyo Aug 30, 2024
72108a5
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Aug 30, 2024
11b4ef2
Diff cleanup
tsullivan Aug 30, 2024
3bea21d
Move FormValues interface to /management/types
tsullivan Aug 30, 2024
3592d31
Update placeholder text for Solution View picker
tsullivan Aug 30, 2024
0314b3f
increase width of assign roles flyout
tsullivan Aug 30, 2024
db8fe26
Improve error handling
tsullivan Aug 30, 2024
72be2d4
custom sorting for roles in listing
tsullivan Aug 30, 2024
4893351
fix missing context in test
tsullivan Aug 30, 2024
813f33c
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 3, 2024
2452e53
fix i18n check
tsullivan Sep 3, 2024
1ae925c
Refresh the list of roles when user navigates to “Assigned roles” tab
tsullivan Sep 3, 2024
a86f1f4
Error handling for bulk update of roles
tsullivan Sep 3, 2024
5a88893
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 3, 2024
f016bfe
Update unselectable message
tsullivan Sep 3, 2024
6733b44
Fix type check
tsullivan Sep 3, 2024
18b4af9
fix i18n tooling issue
tsullivan Sep 3, 2024
814651c
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 5, 2024
976cb8d
remove ability to bulk edit roles that are assigned to a space
tsullivan Sep 5, 2024
bedf007
fix ts issues
tsullivan Sep 5, 2024
e8f7426
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 6, 2024
4027175
Granularity for titles and descriptions of action icons for not-edita…
tsullivan Sep 6, 2024
a8b40b1
Fewer LOC for i18n strings
tsullivan Sep 6, 2024
2681f1f
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 9, 2024
4aed39e
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 11, 2024
61b2c73
Add more exports of interfaces from security/plugin_types_public
tsullivan Sep 11, 2024
3435f1a
text copy changes, fix localization, fix sorting by role name
tsullivan Sep 11, 2024
8ba04d0
fix spaces manager mock
tsullivan Sep 11, 2024
7dfc924
Updates per upgrade of @testing-library/user-event
tsullivan Sep 11, 2024
fe31eb8
more consistency for data-test-subj
tsullivan Sep 11, 2024
9254bd7
Add new constants in plugins/spaces/common
tsullivan Sep 11, 2024
33f26f6
Apply suggestions from code review
tsullivan Sep 11, 2024
316ccff
Merge branch 'spaces/assign-roles-to-space' of github.com:elastic/kib…
tsullivan Sep 11, 2024
fbd874a
remove usage of "any"
tsullivan Sep 11, 2024
ab99690
clean up if/for/if constructs
tsullivan Sep 11, 2024
16b9720
text copy
tsullivan Sep 11, 2024
95582d5
fix naming of edit_space_provider
tsullivan Sep 11, 2024
79c0129
fix naming of CustomizeSpaceFormValues
tsullivan Sep 11, 2024
ca58ca6
explanation comment for SpaceContentTypeSummaryItem
tsullivan Sep 11, 2024
bceb3aa
_state => clonedState
tsullivan Sep 11, 2024
9ac893e
Comment on how removeRole in bulk-edit works
tsullivan Sep 11, 2024
1395f76
add explanation comment regarding meaning of "active space" and "curr…
tsullivan Sep 11, 2024
3924608
Consistent handleApiError
tsullivan Sep 11, 2024
a34a44f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 11, 2024
d92214e
Fix ability to set space avatar
tsullivan Sep 11, 2024
379754a
Use logger from core service
tsullivan Sep 11, 2024
7bd81f3
fix tests
tsullivan Sep 12, 2024
f7ddd92
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 12, 2024
2dd6c57
improve test coverage
eokoneyo Sep 13, 2024
0a80282
keep assign button disabled till a role selection has been made
eokoneyo Sep 13, 2024
07f92e1
Merge branch 'main' into spaces/assign-roles-to-space
elasticmachine Sep 13, 2024
65b3e4a
make bulk actions for role asisgned table opt-in
eokoneyo Sep 16, 2024
6b929ea
Merge branch 'main' into spaces/assign-roles-to-space
elasticmachine Sep 16, 2024
482260d
even more copy and minor ui fixes from product feedback
eokoneyo Sep 16, 2024
cf7e9a9
add subtle link to manage roles in role selection combobox
eokoneyo Sep 16, 2024
d70ae24
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 16, 2024
9a8e335
empty the disabled features list when the solution view non-classic
tsullivan Sep 16, 2024
0fe3f4b
Reorganize create_edit_space tests to dedicated folder
tsullivan Sep 16, 2024
110a0b3
Test that verifies changing space avatar
tsullivan Sep 16, 2024
21c2d56
display kibana privilege form for all privilege selection
eokoneyo Sep 17, 2024
bf8eea7
revamp role assignment flyout to match new design
eokoneyo Sep 17, 2024
fc40515
create consolidate representation for edit operation privilege assign…
eokoneyo Sep 17, 2024
89278c9
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 17, 2024
ebe0c6a
Add rolesFetchError to state
tsullivan Sep 17, 2024
a1e533e
Update message on security access to features based on ability to man…
tsullivan Sep 17, 2024
bdc1a5c
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 18, 2024
385d2a1
add space role assignment flyout help text to match updated designs
eokoneyo Sep 18, 2024
ae73405
Merge branch 'main' into spaces/assign-roles-to-space
tsullivan Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion x-pack/packages/security/plugin_types_public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export type {
UserProfileSuggestParams,
UserProfileAPIClient,
} from './src/user_profile';
export type { RolePutPayload, RolesAPIClient } from './src/roles';
export type {
BulkUpdatePayload,
BulkUpdateRoleResponse,
RolePutPayload,
RolesAPIClient,
} from './src/roles';
export { PrivilegesAPIClientPublicContract } from './src/privileges';
export type { PrivilegesAPIClientGetAllArgs } from './src/privileges';
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface PrivilegesAPIClientGetAllArgs {
*/
respectLicenseLevel: boolean;
}
// TODO: Eyo include the proper return types for contract

export abstract class PrivilegesAPIClientPublicContract {
abstract getAll(args: PrivilegesAPIClientGetAllArgs): Promise<RawKibanaPrivileges>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
* 2.0.
*/

export type { RolePutPayload, RolesAPIClient } from './roles_api_client';
export type {
BulkUpdatePayload,
BulkUpdateRoleResponse,
RolePutPayload,
RolesAPIClient,
} from './roles_api_client';
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@ export interface RolePutPayload {
createOnly?: boolean;
}

export interface BulkUpdatePayload {
rolesUpdate: Role[];
}

export interface BulkUpdateRoleResponse {
created?: string[];
updated?: string[];
errors?: Record<string, { type: string; reason: string }>;
}

export interface RolesAPIClient {
getRoles: () => Promise<Role[]>;
getRole: (roleName: string) => Promise<Role>;
deleteRole: (roleName: string) => Promise<void>;
saveRole: (payload: RolePutPayload) => Promise<void>;
bulkUpdateRoles: (payload: BulkUpdatePayload) => Promise<BulkUpdateRoleResponse>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {
kibanaFeatures,
} from '@kbn/security-role-management-model/src/__fixtures__';
import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers';
import type { Role } from '@kbn/security-plugin-types-common';

import { getDisplayedFeaturePrivileges } from './__fixtures__';
import { FeatureTable } from './feature_table';
import type { Role } from '@kbn/security-plugin-types-common';
import { PrivilegeFormCalculator } from '../privilege_form_calculator';

const createRole = (kibana: Role['kibana'] = []): Role => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ interface Props {
canCustomizeSubFeaturePrivileges: boolean;
allSpacesSelected: boolean;
disabled?: boolean;
/**
* default is true, to remain backwards compatible
*/
showTitle?: boolean;
}

interface State {
Expand All @@ -58,6 +62,7 @@ export class FeatureTable extends Component<Props, State> {
public static defaultProps = {
privilegeIndex: -1,
showLocks: true,
showTitle: true,
};

private featureCategories: Map<string, SecuredFeature[]> = new Map();
Expand Down Expand Up @@ -187,16 +192,18 @@ export class FeatureTable extends Component<Props, State> {
<div>
<EuiFlexGroup alignItems={'flexEnd'}>
<EuiFlexItem>
<EuiText size="xs">
<b>
{i18n.translate(
'xpack.security.management.editRole.featureTable.featureVisibilityTitle',
{
defaultMessage: 'Customize feature privileges',
}
)}
</b>
</EuiText>
{this.props.showTitle && (
<EuiText size="xs">
<b>
{i18n.translate(
'xpack.security.management.editRole.featureTable.featureVisibilityTitle',
{
defaultMessage: 'Customize feature privileges',
}
)}
</b>
</EuiText>
)}
</EuiFlexItem>
{!this.props.disabled && (
<EuiFlexItem grow={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
createKibanaPrivileges,
kibanaFeatures,
} from '@kbn/security-role-management-model/src/__fixtures__';
import type { Role } from '@kbn/security-plugin-types-common';
import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers';

import { FeatureTableExpandedRow } from './feature_table_expanded_row';
import type { Role } from '@kbn/security-plugin-types-common';
import { PrivilegeFormCalculator } from '../privilege_form_calculator';

const createRole = (kibana: Role['kibana'] = []): Role => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
createKibanaPrivileges,
kibanaFeatures,
} from '@kbn/security-role-management-model/src/__fixtures__';
import type { Role } from '@kbn/security-plugin-types-common';

import { PrivilegeFormCalculator } from './privilege_form_calculator';
import type { Role } from '@kbn/security-plugin-types-common';

const createRole = (kibana: Role['kibana'] = []): Role => {
return {
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/security/public/authentication/index.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const authorizationMock = {
getRole: jest.fn(),
deleteRole: jest.fn(),
saveRole: jest.fn(),
bulkUpdateRoles: jest.fn(),
},
privileges: {
getAll: jest.fn(),
Expand All @@ -43,6 +44,7 @@ export const authorizationMock = {
getRole: jest.fn(),
deleteRole: jest.fn(),
saveRole: jest.fn(),
bulkUpdateRoles: jest.fn(),
},
privileges: {
getAll: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class AuthorizationService {
getRole: rolesAPIClient.getRole,
deleteRole: rolesAPIClient.deleteRole,
saveRole: rolesAPIClient.saveRole,
bulkUpdateRoles: rolesAPIClient.bulkUpdateRoles,
},
privileges: {
getAll: privilegesAPIClient.getAll.bind(privilegesAPIClient),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
EuiFlexItem,
EuiForm,
EuiFormRow,
EuiIconTip,
EuiPanel,
EuiSpacer,
EuiText,
Expand Down Expand Up @@ -556,52 +557,46 @@ export const EditRolePage: FunctionComponent<Props> = ({

const getElasticsearchPrivileges = () => {
return (
<div>
<EuiSpacer />
<ElasticsearchPrivileges
role={role}
editable={!isRoleReadOnly}
indicesAPIClient={indicesAPIClient}
onChange={onRoleChange}
runAsUsers={runAsUsers}
validator={validator}
indexPatterns={indexPatternsTitles}
remoteClusters={remoteClustersState.value}
builtinESPrivileges={builtInESPrivileges}
license={license}
docLinks={docLinks}
canUseRemoteIndices={
buildFlavor === 'traditional' && featureCheckState.value?.canUseRemoteIndices
}
canUseRemoteClusters={
buildFlavor === 'traditional' && featureCheckState.value?.canUseRemoteClusters
}
isDarkMode={isDarkMode}
buildFlavor={buildFlavor}
/>
</div>
<ElasticsearchPrivileges
role={role}
editable={!isRoleReadOnly}
indicesAPIClient={indicesAPIClient}
onChange={onRoleChange}
runAsUsers={runAsUsers}
validator={validator}
indexPatterns={indexPatternsTitles}
remoteClusters={remoteClustersState.value}
builtinESPrivileges={builtInESPrivileges}
license={license}
docLinks={docLinks}
canUseRemoteIndices={
buildFlavor === 'traditional' && featureCheckState.value?.canUseRemoteIndices
}
canUseRemoteClusters={
buildFlavor === 'traditional' && featureCheckState.value?.canUseRemoteClusters
}
isDarkMode={isDarkMode}
buildFlavor={buildFlavor}
/>
);
};

const onRoleChange = (newRole: Role) => setRole(newRole);

const getKibanaPrivileges = () => {
return (
<div>
<EuiSpacer />
<KibanaPrivilegesRegion
kibanaPrivileges={new KibanaPrivileges(kibanaPrivileges, features)}
spaces={spaces.list}
spacesEnabled={spaces.enabled}
uiCapabilities={uiCapabilities}
canCustomizeSubFeaturePrivileges={license.getFeatures().allowSubFeaturePrivileges}
editable={!isRoleReadOnly}
role={role}
onChange={onRoleChange}
validator={validator}
spacesApiUi={spacesApiUi}
/>
</div>
<KibanaPrivilegesRegion
kibanaPrivileges={new KibanaPrivileges(kibanaPrivileges, features)}
spaces={spaces.list}
spacesEnabled={spaces.enabled}
uiCapabilities={uiCapabilities}
canCustomizeSubFeaturePrivileges={license.getFeatures().allowSubFeaturePrivileges}
editable={!isRoleReadOnly}
role={role}
onChange={onRoleChange}
validator={validator}
spacesApiUi={spacesApiUi}
/>
);
};

Expand Down Expand Up @@ -800,44 +795,89 @@ export const EditRolePage: FunctionComponent<Props> = ({

return (
<div className="editRolePage">
<EuiForm {...formError}>
{getFormTitle()}
<EuiSpacer />
<EuiText size="s">
<FormattedMessage
id="xpack.security.management.editRole.setPrivilegesToKibanaSpacesDescription"
defaultMessage="Set privileges on your Elasticsearch data and control access to your Project spaces."
/>
</EuiText>
{isRoleReserved && (
<Fragment>
<EuiSpacer size="s" />
<EuiText size="s" color="subdued">
<p id="reservedRoleDescription" tabIndex={0}>
<EuiForm {...formError} fullWidth>
<EuiFlexGroup direction="column">
<EuiFlexItem>
{getFormTitle()}
<EuiSpacer />
<EuiText size="s">
<FormattedMessage
id="xpack.security.management.editRole.setPrivilegesToKibanaSpacesDescription"
defaultMessage="Set privileges on your Elasticsearch data and control access to your Project spaces."
/>
</EuiText>
</EuiFlexItem>
<EuiFlexItem>
{isRoleReserved && (
<Fragment>
<EuiText size="s" color="subdued">
<p id="reservedRoleDescription" tabIndex={0}>
<FormattedMessage
id="xpack.security.management.editRole.modifyingReversedRolesDescription"
defaultMessage="Reserved roles are built-in and cannot be removed or modified."
/>
</p>
</EuiText>
</Fragment>
)}
</EuiFlexItem>
<EuiFlexItem>
{isDeprecatedRole && (
<Fragment>
<EuiSpacer size="s" />
<EuiCallOut
title={getExtendedRoleDeprecationNotice(role)}
color="warning"
iconType="warning"
/>
</Fragment>
)}
</EuiFlexItem>
<EuiFlexItem>{getRoleNameAndDescription()}</EuiFlexItem>
<EuiFlexItem>
<EuiFormRow
label={
<FormattedMessage
id="xpack.security.management.editRole.modifyingReversedRolesDescription"
defaultMessage="Reserved roles are built-in and cannot be removed or modified."
id="xpack.security.management.editRole.dataLayerLabel"
defaultMessage="Data Layer"
/>
</p>
</EuiText>
</Fragment>
)}
{isDeprecatedRole && (
<Fragment>
<EuiSpacer size="s" />
<EuiCallOut
title={getExtendedRoleDeprecationNotice(role)}
color="warning"
iconType="warning"
/>
</Fragment>
)}
<EuiSpacer />
{getRoleNameAndDescription()}
{getElasticsearchPrivileges()}
{getKibanaPrivileges()}
<EuiSpacer />
{getFormButtons()}
}
>
{getElasticsearchPrivileges()}
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem>
<EuiFormRow
label={
<EuiFlexGroup gutterSize="s" alignItems="center" responsive={false}>
<EuiFlexItem grow={false}>
<FormattedMessage
id="xpack.security.management.editRole.appLayerLabel"
defaultMessage="Application layer"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIconTip
type="iInCircle"
color="subdued"
content={
<FormattedMessage
id="xpack.security.management.editRole.appLayerTooltipText"
defaultMessage="Feature access is granted on a per space basis for all features. Feature visibility is set on the space. Both must be enabled for this role to use a feature"
/>
}
/>
</EuiFlexItem>
</EuiFlexGroup>
}
>
{getKibanaPrivileges()}
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem>
<EuiFormRow fullWidth={false}>{getFormButtons()}</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
</EuiForm>
</div>
);
Expand Down
Loading