wrap creating default roles with entity access enabled check to prevent exception at startup
@@ -52,6 +52,7 @@ import com.thinkbiganalytics.metadata.modeshape.security.action.JcrAllowedAction
import com.thinkbiganalytics.metadata.modeshape.support.JcrPropertyUtil;
import com.thinkbiganalytics.metadata.modeshape.template.JcrFeedTemplate;
import com.thinkbiganalytics.metadata.upgrade.version_0_7_1.UpgradeAction;
+import com.thinkbiganalytics.security.AccessController;
import com.thinkbiganalytics.security.action.Action;
import com.thinkbiganalytics.security.action.AllowableAction;
import com.thinkbiganalytics.security.action.AllowedActions;
@@ -111,6 +112,9 @@ public class UpgradeKyloService implements PostMetadataConfigAction {
@Inject
private AllowedEntityActionsProvider actionsProvider;
+ @Inject
+ private AccessController accessController;
+
public void run() {
onMetadataStart();
@@ -173,9 +177,11 @@ public class UpgradeKyloService implements PostMetadataConfigAction {
private void onMetadataStart() {
if(kyloVersionProvider.isUpToDate()) {
ensureFeedTemplateFeedRelationships();
+ if(accessController.isEntityAccessControlled()) {
ensureDefaultEntityRoles();
}
}
+ }
private void setupFreshInstall() {
metadataAccess.commit(() -> {
