mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Merge branch '0.8.x' of https://github.com/appwrite/appwrite into feat-upgrade-php-version
This commit is contained in:
commit
3d960a2971
61 files changed
+994
-277
No files matched your search
@@ -243,7 +243,7 @@ class Auth
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isPreviliggedUser(array $roles): bool
|
||||
public static function isPrivilegedUser(array $roles): bool
|
||||
{
|
||||
if(
|
||||
array_key_exists('role:'.self::USER_ROLE_OWNER, $roles) ||
|
||||
|
||||
@@ -283,6 +283,9 @@ class MySQL extends Adapter
|
||||
if (\is_array($prop['value'])) {
|
||||
throw new Exception('Value can\'t be an array: '.\json_encode($prop['value']));
|
||||
}
|
||||
if (\is_bool($prop['value'])) {
|
||||
$prop['value'] = (int) $prop['value'];
|
||||
}
|
||||
$st2->bindValue(':documentUid', $data['$id'], PDO::PARAM_STR);
|
||||
$st2->bindValue(':documentRevision', $revision, PDO::PARAM_STR);
|
||||
|
||||
|
||||
@@ -89,6 +89,12 @@ class Project extends Model
|
||||
'default' => '',
|
||||
'example' => '131102020',
|
||||
])
|
||||
->addRule('usersAuthLimit', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Max users allowed. 0 is unlimited.',
|
||||
'default' => 0,
|
||||
'example' => 100,
|
||||
])
|
||||
->addRule('platforms', [
|
||||
'type' => Response::MODEL_PLATFORM,
|
||||
'description' => 'List of Platforms.',
|
||||
@@ -127,6 +133,7 @@ class Project extends Model
|
||||
;
|
||||
|
||||
$providers = Config::getParam('providers', []);
|
||||
$auth = Config::getParam('auth', []);
|
||||
|
||||
foreach ($providers as $index => $provider) {
|
||||
if (!$provider['enabled']) {
|
||||
@@ -150,6 +157,20 @@ class Project extends Model
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
foreach ($auth as $index => $method) {
|
||||
$name = $method['name'] ?? '';
|
||||
$key = $method['key'] ?? '';
|
||||
|
||||
$this
|
||||
->addRule($key, [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => $name.' auth method status',
|
||||
'example' => true,
|
||||
'default' => true,
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user