Skip to content

Commit

Permalink
[Fix]Removes synonyms read-only permission. (elastic#211471)
Browse files Browse the repository at this point in the history
## Summary

Kibana permission for read-only is removed. This is not a breaking
change while the feature is not yet released.
Cluster requirements make it obsolete.
Also fixed warnings on permission names.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
efegurkan authored Feb 18, 2025
1 parent 46132d8 commit 148d47c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
11 changes: 5 additions & 6 deletions x-pack/solutions/search/plugins/search_synonyms/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,29 @@ export class SearchSynonymsPlugin
privileges: {
all: {
app: ['kibana', PLUGIN_ID],
api: ['synonyms:manage', 'synonyms:read'],
api: ['manage_synonyms'],
catalogue: [PLUGIN_ID],
savedObject: {
all: [],
read: [],
},
ui: ['read', 'save'],
ui: ['manage'],
},
read: {
app: ['kibana', PLUGIN_ID],
api: ['synonyms:read'],
disabled: true,
savedObject: {
all: [],
read: [],
},
ui: ['read'],
ui: [],
},
},
});

return {};
}

public start(core: CoreStart) {
public start(_: CoreStart) {
return {};
}

Expand Down
24 changes: 8 additions & 16 deletions x-pack/solutions/search/plugins/search_synonyms/server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SETS,
options: {
access: 'internal',
tags: ['synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -78,11 +77,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SET_ID,
options: {
access: 'internal',
tags: ['synonyms:write', 'synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:write', 'synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -119,11 +117,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SET_ID,
options: {
access: 'internal',
tags: ['synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -177,11 +174,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SET_ID_RULE_ID,
options: {
access: 'internal',
tags: ['synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -228,11 +224,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SET_ID_RULE_ID,
options: {
access: 'internal',
tags: ['synonyms:write', 'synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:write', 'synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -279,11 +274,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SET_ID,
options: {
access: 'internal',
tags: ['synonyms:write', 'synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:write', 'synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -328,11 +322,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.GENERATE_SYNONYM_RULE_ID,
options: {
access: 'internal',
tags: ['synonyms:write', 'synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:write', 'synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down Expand Up @@ -377,11 +370,10 @@ export function defineRoutes({ logger, router }: { logger: Logger; router: IRout
path: APIRoutes.SYNONYM_SET_ID_RULE_ID,
options: {
access: 'internal',
tags: ['synonyms:write', 'synonyms:read'],
},
security: {
authz: {
requiredPrivileges: ['synonyms:write', 'synonyms:read'],
requiredPrivileges: ['manage_synonyms'],
},
},
validate: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
'enterpriseSearchApplications',
'enterpriseSearchAnalytics',
'searchPlayground',
'searchSynonyms',
'searchInferenceEndpoints',
'guidedOnboardingFeature',
'securitySolutionAssistant',
Expand Down

0 comments on commit 148d47c

Please sign in to comment.