Users want to be able to mark their profiles as “private”. This will prevent all users from viewing their profile except for the user who owns the profile as well as admin users.
visibility enum field to Profiledef change
add_column :profiles, :visibility, :integer, default: 0, null: false
end
# app/models/profile.rb
class Profile < ApplicationRecord
enum {
private: 0,
public: 1
}
end
Pros
Cons
agency_viewable (probably not a great name lol) where it’s viewable by all agency members/admins but still not publicly viewable.public boolean field to Profiledef change
add_column :profiles, :public, :boolean, default: false, null: false
end
A profile is considered “private” if this boolean field is false and public if it’s true
Pros
Cons