Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
61a0978b
Commit
61a0978b
authored
Dec 22, 2018
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare KPI Executions for ACL
parent
46cf8694
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
28 deletions
+16
-28
src/main/java/org/genesys2/server/component/listener/ApplicationUpgrades.java
...nesys2/server/component/listener/ApplicationUpgrades.java
+16
-26
src/main/java/org/genesys2/spring/config/ApplicationStartup.java
...n/java/org/genesys2/spring/config/ApplicationStartup.java
+0
-2
No files found.
src/main/java/org/genesys2/s
pring/config
/ApplicationUpgrades.java
→
src/main/java/org/genesys2/s
erver/component/listener
/ApplicationUpgrades.java
View file @
61a0978b
...
...
@@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.genesys2.s
pring.config
;
package
org.genesys2.s
erver.component.listener
;
import
org.genesys.
filerepository.migration.RepositoryUpgrade20180920
;
import
org.genesys.
blocks.security.service.CustomAclService
;
import
org.genesys2.server.component.security.AsAdminInvoker
;
import
org.genesys2.server.persistence.kpi.ExecutionRepository
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.
context.annotation.DependsOn
;
import
org.springframework.
stereotype.Component
;
/**
* Declare sorts of things that upgrade the existing database
...
...
@@ -31,7 +31,7 @@ import org.springframework.context.annotation.DependsOn;
* @author Matija Obreza
* @since 2.4
*/
@Co
nfiguration
@Co
mponent
public
class
ApplicationUpgrades
implements
InitializingBean
{
/** The Constant LOG. */
...
...
@@ -46,33 +46,23 @@ public class ApplicationUpgrades implements InitializingBean {
*/
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
}
/**
* Repository upgrade 20180920.
*
* @return the repository upgrade 20180920
* @throws Exception
*/
// TODO Remove in 2.5
@Bean
@DependsOn
({
"currentApplicationContext"
})
protected
RepositoryUpgrade20180920
repositoryUpgrade20180920
()
throws
Exception
{
return
new
RepositoryUpgrade20180920
();
kpiEnsureACL
();
}
@Autowired
private
ExecutionRepository
kpiExecutionRepository
;
@Autowired
private
CustomAclService
aclService
;
@Bean
protected
RepositoryUpgrade20180920
afterRepositoryUpgrade20180920
(
RepositoryUpgrade20180920
repositoryUpgrade20180920
)
throws
Exception
{
protected
void
kpiEnsureACL
()
throws
Exception
{
asAdminInvoker
.
invoke
(()
->
{
LOG
.
warn
(
"Running afterRepositoryUpgrade20180920"
);
LOG
.
warn
(
"Adding ACL support to KPI Execution"
);
kpiExecutionRepository
.
findAll
().
forEach
(
execution
->
{
LOG
.
warn
(
"Making KPI Execution {} ACL-ready"
,
execution
.
getName
());
aclService
.
createOrUpdatePermissions
(
execution
);
});
return
true
;
});
return
null
;
}
}
src/main/java/org/genesys2/spring/config/ApplicationStartup.java
View file @
61a0978b
...
...
@@ -34,7 +34,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Component
;
...
...
@@ -44,7 +43,6 @@ import com.google.common.collect.Sets;
* Run things at startup and after application context is initialized.
*/
@Component
@Import
({
ApplicationUpgrades
.
class
})
public
class
ApplicationStartup
implements
InitializingBean
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
ApplicationStartup
.
class
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment