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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user