RedirectController into auto config as default and null pointer fix. (#621)

* Vaadin patch and redirect controller to auto config.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix potential null pointer.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* revert Vaadin update.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Conditional on missing bean.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix on permission checks.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix permission checks.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix nested cascade on delete.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2018-01-19 11:23:41 +01:00
committed by GitHub
parent df41fc0e4e
commit 722c5ad2c2
23 changed files with 173 additions and 98 deletions

View File

@@ -121,8 +121,9 @@ public abstract class AbstractJpaBaseEntity implements BaseEntity {
}
private boolean isController() {
return SecurityContextHolder.getContext().getAuthentication()
.getDetails() instanceof TenantAwareAuthenticationDetails
return SecurityContextHolder.getContext().getAuthentication() != null
&& SecurityContextHolder.getContext().getAuthentication()
.getDetails() instanceof TenantAwareAuthenticationDetails
&& ((TenantAwareAuthenticationDetails) SecurityContextHolder.getContext().getAuthentication()
.getDetails()).isController();
}

View File

@@ -72,8 +72,9 @@ public class JpaRolloutGroup extends AbstractJpaNamedEntity implements RolloutGr
CascadeType.PERSIST }, targetEntity = RolloutTargetGroup.class)
private List<RolloutTargetGroup> rolloutTargetGroup;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rolloutgroup_rolloutgroup"))
// No foreign key to avoid to many nested cascades on delete which some DBs cannot handle
@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST })
@JoinColumn(name = "parent_id")
private JpaRolloutGroup parent;
@Column(name = "success_condition", nullable = false)

View File

@@ -0,0 +1 @@
alter table sp_rolloutgroup drop constraint fk_rolloutgroup_rolloutgroup;

View File

@@ -0,0 +1 @@
alter table sp_rolloutgroup drop FOREIGN KEY fk_rolloutgroup_rolloutgroup;