2323
2424use Doctrine \DBAL \DBALException ;
2525use OC \Cache \CappedMemoryCache ;
26+ use OCA \WorkflowEngine \AppInfo \Application ;
2627use OCA \WorkflowEngine \Check \FileMimeType ;
2728use OCA \WorkflowEngine \Check \FileName ;
2829use OCA \WorkflowEngine \Check \FileSize ;
4041use OCP \DB \QueryBuilder \IQueryBuilder ;
4142use OCP \EventDispatcher \IEventDispatcher ;
4243use OCP \Files \Storage \IStorage ;
44+ use OCP \IConfig ;
4345use OCP \IDBConnection ;
4446use OCP \IL10N ;
4547use OCP \ILogger ;
@@ -108,14 +110,18 @@ class Manager implements IManager {
108110 /** @var IEventDispatcher */
109111 private $ dispatcher ;
110112
113+ /** @var IConfig */
114+ private $ config ;
115+
111116 public function __construct (
112117 IDBConnection $ connection ,
113118 IServerContainer $ container ,
114119 IL10N $ l ,
115120 LegacyDispatcher $ eventDispatcher ,
116121 ILogger $ logger ,
117122 IUserSession $ session ,
118- IEventDispatcher $ dispatcher
123+ IEventDispatcher $ dispatcher ,
124+ IConfig $ config
119125 ) {
120126 $ this ->connection = $ connection ;
121127 $ this ->container = $ container ;
@@ -125,6 +131,7 @@ public function __construct(
125131 $ this ->operationsByScope = new CappedMemoryCache (64 );
126132 $ this ->session = $ session ;
127133 $ this ->dispatcher = $ dispatcher ;
134+ $ this ->config = $ config ;
128135 }
129136
130137 public function getRuleMatcher (): IRuleMatcher {
@@ -704,4 +711,8 @@ protected function getBuildInChecks(): array {
704711 return [];
705712 }
706713 }
714+
715+ public function isUserScopeEnabled (): bool {
716+ return $ this ->config ->getAppValue (Application::APP_ID , 'user_scope_disabled ' , 'no ' ) === 'no ' ;
717+ }
707718}
0 commit comments