Fixed structures
This commit is contained in:
parent
3086111bb9
commit
11056a04c3
1 changed files with 4 additions and 10 deletions
|
@ -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;
|
Loading…
Reference in a new issue