-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New permissions for profiles. Fixed permission checks in a few places… (
#17986) * New permissions for profiles. Fixed permission checks in a few places. Migration to upgrade built-in role. * Improved role name in migration * More verbose naming of profiles permissions * Permission naming more verbose in constants as well
- Loading branch information
1 parent
383de5a
commit 75ce9ac
Showing
5 changed files
with
87 additions
and
15 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
51 changes: 51 additions & 0 deletions
51
...g2/migrations/V20240118130000_FieldTypeMappingsManagerRoleReceivesProfilePermissions.java
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,51 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
package org.graylog2.migrations; | ||
|
||
import jakarta.inject.Inject; | ||
import org.graylog2.shared.security.RestPermissions; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.Set; | ||
|
||
public class V20240118130000_FieldTypeMappingsManagerRoleReceivesProfilePermissions extends Migration { | ||
private final MigrationHelpers helpers; | ||
|
||
@Inject | ||
public V20240118130000_FieldTypeMappingsManagerRoleReceivesProfilePermissions(final MigrationHelpers migrationHelpers) { | ||
this.helpers = migrationHelpers; | ||
} | ||
|
||
@Override | ||
public ZonedDateTime createdAt() { | ||
return ZonedDateTime.parse("2024-01-18T13:00:00Z"); | ||
} | ||
|
||
@Override | ||
public void upgrade() { | ||
helpers.ensureBuiltinRole("Field Type Mappings Manager", | ||
"Grants full control over custom field type mappings and field type profiles for all index sets (built-in)", | ||
Set.of(RestPermissions.TYPE_MAPPINGS_CREATE, | ||
RestPermissions.TYPE_MAPPINGS_DELETE, | ||
RestPermissions.TYPE_MAPPINGS_EDIT, | ||
RestPermissions.TYPE_MAPPINGS_READ, | ||
RestPermissions.MAPPING_PROFILES_CREATE, | ||
RestPermissions.MAPPING_PROFILES_DELETE, | ||
RestPermissions.MAPPING_PROFILES_EDIT, | ||
RestPermissions.MAPPING_PROFILES_READ)); | ||
} | ||
} |
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