forked from e621ng/e621ng
Make default user level and settings configurable.
Remove start_as_gold? and start_as_contributor? from default config because they don't actually do anything. `git log -G start_as` indicates they never have done anything. Add a more general customize_new_user method for setting the starting user level, permissions and defaults for any other settings.
This commit is contained in:
parent
ebff27c7c0
commit
c3b55e80c5
@ -64,6 +64,7 @@ class User < ActiveRecord::Base
|
||||
after_save :update_cache
|
||||
after_update :update_remote_cache
|
||||
before_create :promote_to_admin_if_first_user
|
||||
before_create :customize_new_user
|
||||
#after_create :notify_sock_puppets
|
||||
has_many :feedback, :class_name => "UserFeedback", :dependent => :destroy
|
||||
has_many :posts, :foreign_key => "uploader_id"
|
||||
@ -311,6 +312,10 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def customize_new_user
|
||||
Danbooru.config.customize_new_user(self)
|
||||
end
|
||||
|
||||
def role
|
||||
case level
|
||||
when Levels::MEMBER
|
||||
|
@ -49,14 +49,19 @@ module Danbooru
|
||||
"choujin-steiner"
|
||||
end
|
||||
|
||||
# Set to true to give all new users gold access.
|
||||
def start_as_gold?
|
||||
false
|
||||
end
|
||||
|
||||
# Set to true to give all new users contributor access.
|
||||
def start_as_contributor?
|
||||
false
|
||||
# Set the default level, permissions, and other settings for new users here.
|
||||
def customize_new_user(user)
|
||||
# user.level = User::Levels::MEMBER
|
||||
# user.can_approve_posts = false
|
||||
# user.can_upload_free = false
|
||||
# user.is_super_voter = false
|
||||
#
|
||||
# user.base_upload_limit = 10
|
||||
# user.comment_threshold = -1
|
||||
# user.blacklisted_tags = ["spoilers", "guro", "scat", "furry -rating:s"].join("\n")
|
||||
# user.default_image_size = "large"
|
||||
# user.per_page = 20
|
||||
# user.disable_tagged_filenames = false
|
||||
end
|
||||
|
||||
# What method to use to store images.
|
||||
|
Loading…
Reference in New Issue
Block a user