discourse/lib/validators
Guhyoun Nam 9c1812e071
FEATURE: add system_user_max_attachment_size_kb site setting (#28351)
* System user attachment size WIP

* spec check

* controller update

* add max to system_user_max_attachment_size_kb

* DEV: update to use static method for `max_attachment_size_for_user`

add test to use large image.
add check for failure.

* DEV: update `system_user_max_attachment_size_kb` default value to 0

remove unecessary test.
update tests to reflect the new default value of `system_user_max_attachment_size_kb`

* DEV: update maximum_file_size to check when is an attachment made by a system user

Add tests for when `system_user_max_attachment_size_kb` is over and under the limit
Add test for checking interaction with `max_attachment_size_kb`

* DEV: move `max_attachment_size_for_user` to private methods

* DEV: turn `max_attachment_size_for_user` into a static method

* DEV: typo in test case

* DEV: move max_attachment_size_for_user to private class method

* Revert "DEV: move max_attachment_size_for_user to private class method"

This reverts commit 5d5ae0b715.

---------

Co-authored-by: Gabriel Grubba <gabriel@discourse.org>
2024-08-16 11:03:39 -03:00
..
allow_user_locale_enabled_validator.rb
allowed_iframes_validator.rb DEV: Add validation for allowed iframes setting (#28178) 2024-08-01 06:51:02 -06:00
allowed_ip_address_validator.rb
alternative_reply_by_email_addresses_validator.rb
at_least_one_group_validator.rb
categories_topics_validator.rb
category_search_priority_weights_validator.rb
censored_words_validator.rb
color_list_validator.rb
csp_script_src_validator.rb DEV: add validation on content_security_policy_script_src site setting (#27564) 2024-06-21 17:00:22 +08:00
css_color_validator.rb
default_composer_category_validator.rb
delete_rejected_email_after_days_validator.rb
email_address_validator.rb
email_setting_validator.rb
email_validator.rb
enable_local_logins_via_email_validator.rb
enable_private_email_messages_validator.rb
enable_sso_validator.rb
external_system_avatars_validator.rb
form_template_yaml_validator.rb FIX: restrict a href protocols on form template description (#27472) 2024-06-14 11:39:43 -03:00
google_oauth2_hd_groups_validator.rb
group_setting_validator.rb
host_list_setting_validator.rb
integer_setting_validator.rb
ip_address_format_validator.rb
linkedin_oidc_credentials_validator.rb FEATURE: Allow users to sign in using LinkedIn OpenID Connect (#26281) 2024-04-19 18:47:30 +08:00
markdown_linkify_tlds_validator.rb
markdown_typographer_quotation_marks_validator.rb
max_emojis_validator.rb
max_username_length_validator.rb
min_username_length_validator.rb
not_username_validator.rb
password_validator.rb FEATURE: Allow site admin to mark a user's password as expired (#27314) 2024-06-04 15:42:53 +08:00
pop3_polling_enabled_setting_validator.rb
post_validator.rb DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
quality_title_validator.rb
regex_presence_validator.rb
regex_setting_validation.rb
regex_setting_validator.rb
regexp_list_validator.rb
reply_by_email_address_validator.rb
reply_by_email_enabled_validator.rb
search_ranking_weights_validator.rb
search_tokenize_chinese_validator.rb
search_tokenize_japanese_validator.rb
selectable_avatars_mode_validator.rb
sso_overrides_email_validator.rb
string_setting_validator.rb
stripped_length_validator.rb PERF: bail out of expensive post validations 2024-05-07 18:56:16 +02:00
summarization_validator.rb DEV: Remove summarization code (#27373) 2024-07-02 08:51:47 -07:00
timezone_validator.rb
topic_title_length_validator.rb
unicode_username_allowlist_validator.rb
unicode_username_validator.rb
unique_among_validator.rb
upload_validator.rb FEATURE: add system_user_max_attachment_size_kb site setting (#28351) 2024-08-16 11:03:39 -03:00
url_validator.rb
user_full_name_validator.rb
username_setting_validator.rb
watched_words_validator.rb