-
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.
Improve home screen for limited-access users (#77665)
- Loading branch information
Showing
19 changed files
with
287 additions
and
32 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/plugins/home/public/application/components/__snapshots__/home.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
3 changes: 3 additions & 0 deletions
3
...ns/home/public/application/components/manage_data/__snapshots__/manage_data.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
1 change: 1 addition & 0 deletions
1
...ublic/application/components/solutions_section/__snapshots__/solution_panel.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
130 changes: 130 additions & 0 deletions
130
x-pack/test/functional/apps/home/feature_controls/home_security.ts
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,130 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const security = getService('security'); | ||
const PageObjects = getPageObjects(['security', 'home']); | ||
const testSubjects = getService('testSubjects'); | ||
|
||
describe('security', () => { | ||
before(async () => { | ||
await esArchiver.load('dashboard/feature_controls/security'); | ||
await esArchiver.loadIfNeeded('logstash_functional'); | ||
|
||
// ensure we're logged out so we can login as the appropriate users | ||
await PageObjects.security.forceLogout(); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('dashboard/feature_controls/security'); | ||
|
||
// logout, so the other tests don't accidentally run as the custom users we're testing below | ||
await PageObjects.security.forceLogout(); | ||
}); | ||
|
||
describe('global all privileges', () => { | ||
before(async () => { | ||
await security.role.create('global_all_role', { | ||
elasticsearch: {}, | ||
kibana: [ | ||
{ | ||
base: ['all'], | ||
spaces: ['*'], | ||
}, | ||
], | ||
}); | ||
|
||
await security.user.create('global_all_user', { | ||
password: 'global_all_user-password', | ||
roles: ['global_all_role'], | ||
full_name: 'test user', | ||
}); | ||
|
||
await PageObjects.security.login('global_all_user', 'global_all_user-password', { | ||
expectSpaceSelector: false, | ||
}); | ||
}); | ||
|
||
after(async () => { | ||
await security.role.delete('global_all_role'); | ||
await security.user.delete('global_all_user'); | ||
}); | ||
|
||
it('shows all available solutions', async () => { | ||
const solutions = await PageObjects.home.getVisibileSolutions(); | ||
expect(solutions).to.eql([ | ||
'enterpriseSearch', | ||
'observability', | ||
'securitySolution', | ||
'kibana', | ||
]); | ||
}); | ||
|
||
it('shows the management section', async () => { | ||
await testSubjects.existOrFail('homDataManage', { timeout: 2000 }); | ||
}); | ||
|
||
it('shows the "Manage" action item', async () => { | ||
await testSubjects.existOrFail('homManagementActionItem', { | ||
timeout: 2000, | ||
}); | ||
}); | ||
}); | ||
|
||
describe('global dashboard all privileges', () => { | ||
before(async () => { | ||
await security.role.create('global_dashboard_all_role', { | ||
elasticsearch: {}, | ||
kibana: [ | ||
{ | ||
feature: { | ||
dashboard: ['all'], | ||
}, | ||
spaces: ['*'], | ||
}, | ||
], | ||
}); | ||
|
||
await security.user.create('global_dashboard_all_user', { | ||
password: 'global_dashboard_all_user-password', | ||
roles: ['global_dashboard_all_role'], | ||
full_name: 'test user', | ||
}); | ||
|
||
await PageObjects.security.login( | ||
'global_dashboard_all_user', | ||
'global_dashboard_all_user-password', | ||
{ | ||
expectSpaceSelector: false, | ||
} | ||
); | ||
}); | ||
|
||
after(async () => { | ||
await security.role.delete('global_dashboard_all_role'); | ||
await security.user.delete('global_dashboard_all_user'); | ||
}); | ||
|
||
it('shows only the kibana solution', async () => { | ||
const solutions = await PageObjects.home.getVisibileSolutions(); | ||
expect(solutions).to.eql(['kibana']); | ||
}); | ||
|
||
it('does not show the management section', async () => { | ||
await testSubjects.missingOrFail('homDataManage', { timeout: 2000 }); | ||
}); | ||
|
||
it('does not show the "Manage" action item', async () => { | ||
await testSubjects.missingOrFail('homManagementActionItem', { | ||
timeout: 2000, | ||
}); | ||
}); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.