Skip to content

Commit

Permalink
#1968 Add manageProcedure to analyst role
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Apr 14, 2021
1 parent 23e407c commit c8b24f9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion thehive/app/org/thp/thehive/models/Role.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ object Profile {
Permissions.manageShare,
Permissions.manageAnalyse,
Permissions.managePage,
Permissions.accessTheHiveFS
Permissions.accessTheHiveFS,
Permissions.manageProcedure
)
)
val readonly: Profile = Profile("read-only", Set.empty)
Expand Down
27 changes: 18 additions & 9 deletions thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,15 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema {
traversal.unsafeHas("name", "admin").raw.property("permissions", "managePattern").iterate()
Success(())
}
.updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal =>
traversal
.unsafeHas("name", P.within("org-admin", "analyst"))
.raw
.property("permissions", "manageProcedure")
.iterate()
Success(())
}
.noop
// .updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal =>
// traversal
// .unsafeHas("name", P.within("org-admin", "analyst"))
// .raw
// .property("permissions", "manageProcedure")
// .iterate()
// Success(())
// }
// Index backend
/* Alert index */
.addProperty[Seq[String]]("Alert", "tags")
Expand Down Expand Up @@ -266,7 +267,7 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema {
}
/* CaseTemplate index */
.addProperty[Seq[String]]("CaseTemplate", "tags")
.updateGraph("Add tags in caseTempates", "CaseTemplate") { traversal =>
.updateGraph("Add tags in caseTemplates", "CaseTemplate") { traversal =>
traversal
.project(
_.by
Expand Down Expand Up @@ -471,6 +472,14 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema {
.removeIndex("Task", IndexType.standard)
//=====[release 4.1.3]=====
.removeIndex("global", IndexType.fulltext)
.updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal =>
traversal
.unsafeHas("name", P.within("org-admin", "analyst"))
.raw
.property("permissions", "manageProcedure")
.iterate()
Success(())
}

val reflectionClasses = new Reflections(
new ConfigurationBuilder()
Expand Down

0 comments on commit c8b24f9

Please sign in to comment.