1
0
Fork 0
mirror of synced 2024-09-30 09:18:14 +13:00

Fixed structures

This commit is contained in:
eldadfux 2019-09-03 23:49:13 +03:00
parent 3086111bb9
commit 11056a04c3

View file

@ -1108,15 +1108,12 @@ $collections = [
/** /**
* Add enabled OAuth providers to default data rules * Add enabled OAuth providers to default data rules
*/ */
$oauthProjectsRules = [];
$oauthUsersRules = [];
foreach($providers as $key => $provider) { foreach($providers as $key => $provider) {
if(!$provider['enabled']) { if(!$provider['enabled']) {
continue; continue;
} }
$oauthProjectsRules[] = [ $collections[Database::SYSTEM_COLLECTION_PROJECTS]['rules'][] = [
'$collection' => Database::SYSTEM_COLLECTION_RULES, '$collection' => Database::SYSTEM_COLLECTION_RULES,
'label' => 'OAuth ' . ucfirst($key) . ' ID', 'label' => 'OAuth ' . ucfirst($key) . ' ID',
'key' => 'oauth' . ucfirst($key), 'key' => 'oauth' . ucfirst($key),
@ -1126,7 +1123,7 @@ foreach($providers as $key => $provider) {
'array' => false, 'array' => false,
]; ];
$oauthProjectsRules[] = [ $collections[Database::SYSTEM_COLLECTION_PROJECTS]['rules'][] = [
'$collection' => Database::SYSTEM_COLLECTION_RULES, '$collection' => Database::SYSTEM_COLLECTION_RULES,
'label' => 'OAuth ' . ucfirst($key) . ' Access Token', 'label' => 'OAuth ' . ucfirst($key) . ' Access Token',
'key' => 'oauth' . ucfirst($key) . 'AccessToken', 'key' => 'oauth' . ucfirst($key) . 'AccessToken',
@ -1136,7 +1133,7 @@ foreach($providers as $key => $provider) {
'array' => false, 'array' => false,
]; ];
$oauthUsersRules = [ $collections[Database::SYSTEM_COLLECTION_USERS]['rules'][] = [
'$collection' => Database::SYSTEM_COLLECTION_RULES, '$collection' => Database::SYSTEM_COLLECTION_RULES,
'label' => 'OAuth ' . ucfirst($key) . ' ID', 'label' => 'OAuth ' . ucfirst($key) . ' ID',
'key' => 'oauth' . ucfirst($key), 'key' => 'oauth' . ucfirst($key),
@ -1146,7 +1143,7 @@ foreach($providers as $key => $provider) {
'array' => false, 'array' => false,
]; ];
$oauthUsersRules = [ $collections[Database::SYSTEM_COLLECTION_USERS]['rules'][] = [
'$collection' => Database::SYSTEM_COLLECTION_RULES, '$collection' => Database::SYSTEM_COLLECTION_RULES,
'label' => 'OAuth ' . ucfirst($key) . ' Access Token', 'label' => 'OAuth ' . ucfirst($key) . ' Access Token',
'key' => 'oauth' . ucfirst($key) . 'AccessToken', 'key' => 'oauth' . ucfirst($key) . 'AccessToken',
@ -1157,7 +1154,4 @@ foreach($providers as $key => $provider) {
]; ];
} }
$collections[Database::SYSTEM_COLLECTION_USERS]['rules'] = array_merge($collections[Database::SYSTEM_COLLECTION_USERS]['rules'], $oauthUsersRules);
$collections[Database::SYSTEM_COLLECTION_PROJECTS]['rules'] = array_merge($collections[Database::SYSTEM_COLLECTION_PROJECTS]['rules'], $oauthProjectsRules);
return $collections; return $collections;