@@ -105,7 +105,8 @@ class ConfigService {
105105 public const MEMBERS_LIMIT = 'members_limit ' ;
106106 public const ACTIVITY_ON_NEW_CIRCLE = 'creation_activity ' ;
107107 public const ALLOWED_TYPES = 'allowed_types ' ;
108-
108+ public const CIRCLE_TYPES_FORCE = 'circle_types_force ' ;
109+ public const CIRCLE_TYPES_BLOCK = 'circle_types_block ' ;
109110 public const MIGRATION_BYPASS = 'migration_bypass ' ;
110111 public const MIGRATION_22 = 'migration_22 ' ;
111112 public const MIGRATION_22_1 = 'migration_22_1 ' ;
@@ -180,6 +181,8 @@ class ConfigService {
180181 self ::MEMBERS_LIMIT => '-1 ' ,
181182 self ::ACTIVITY_ON_NEW_CIRCLE => '1 ' ,
182183 self ::ALLOWED_TYPES => Member::ALLOWING_ALL_TYPES ,
184+ self ::CIRCLE_TYPES_FORCE => '0 ' ,
185+ self ::CIRCLE_TYPES_BLOCK => '0 ' ,
183186
184187 self ::MIGRATION_BYPASS => '0 ' ,
185188 self ::MIGRATION_22 => '0 ' ,
@@ -745,4 +748,19 @@ public function linkToRoute(string $route, array $args): string {
745748
746749 return $ path ;
747750 }
751+
752+
753+ /**
754+ * Enforce or Block circle's config/type
755+ *
756+ * @param Circle $circle
757+ */
758+ public function confirmAllowedCircleTypes (Circle $ circle ): void {
759+ $ config = $ circle ->getConfig ();
760+ $ config |= $ this ->getAppValueInt (ConfigService::CIRCLE_TYPES_FORCE );
761+ $ block = $ this ->getAppValueInt (ConfigService::CIRCLE_TYPES_BLOCK );
762+ $ config |= $ block ;
763+ $ config -= $ block ;
764+ $ circle ->setConfig ($ config );
765+ }
748766}
0 commit comments