-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add quota restrictions options #28009
Conversation
/compile amend / |
6972429
to
c5f72c5
Compare
c5f72c5
to
78c3c81
Compare
/compile amend / |
78c3c81
to
d26c684
Compare
|
||
// if unlimited quota is not allowed => avoid getting 'unlimited' as default_quota fallback value | ||
// use the first preset instead | ||
$allowUnlimitedQuota = $this->config->getAppValue('files', 'allow_unlimited_quota', '1') === '1'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if that could be covered by some tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliushaertl Thanks for the review. I made an attempt to implement some tests in tests/lib/User/UserTest.php
.
I'm having trouble to run those tests locally. I've played with
./autotest.sh sqlite lib/User/UserTest.php
but it always says Cannot open file "lib/User/UserTest".
Any idea or hint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. Still not working when using autotest.sh
. Nevermind, working fine with PhpStorm.
After a little fight with PhpUnit, here are 2 small tests 😁.
d4e6a65
to
b467c0a
Compare
/compile amend / |
b467c0a
to
8943546
Compare
I guess we can wait for #28202 |
8943546
to
ea77ada
Compare
/compile amend / |
1 similar comment
/compile amend / |
…quota avoid unlimited quota as default_quota fallback value if unlimited quota is not allowed avoid getting/setting/displaying unlimited default quota if not allowed implement tests for unlimited quota restrictions Signed-off-by: Julien Veyssier <eneiluj@posteo.net> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
ea77ada
to
416d10f
Compare
Drone CI failure is not related (missing dependencies in nodb step). |
/backport to stable22 |
The backport to stable22 failed. Please do this backport manually. |
refs #21045
2 new Files app config options:
allow_unlimited_quota
to toggle unlimited quotamax_quota
to set the maximum quota that can be affected to usersA few things are taken care of:
default_quota
fallback value (when not set). The first quota preset is used instead.Existing quota values and default quota are not affected by these changes. If the default quota or a user's quota has been set to unlimited, switching off unlimited quotas won't change the values. Only future affectations will be denied.
Quota presets are already configurable with the
quota_preset
config value of the Files app.The remaining issue's item to address is
Feel free to add other reviewers 😁.