Added ability to set password for groups
• Added: - ability to set password for groups - GroupPasswordModal - checks for if has password - rate limiting in rack_attack
This commit is contained in:
@@ -4,12 +4,25 @@ class REST::GroupSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :title, :description, :description_html, :cover_image_url, :is_archived,
|
||||
:member_count, :created_at, :is_private, :is_visible, :slug, :tags, :group_category
|
||||
:member_count, :created_at, :is_private, :is_visible, :slug, :tags, :group_category, :password,
|
||||
:has_password
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def has_password
|
||||
return !!password
|
||||
end
|
||||
|
||||
def password
|
||||
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
||||
object.password
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def group_category
|
||||
if object.group_categories
|
||||
object.group_categories
|
||||
|
||||
Reference in New Issue
Block a user