any actual callee will be dealing with a User struct to begin with, so
just check the child struct inside User.superuser?/1 with pattern matching.
def visible_for?(_, _), do: false
- def superuser?(%User{info: %User.Info{} = info}), do: User.Info.superuser?(info)
+ def superuser?(%User{local: true, info: %User.Info{is_admin: true}}), do: true
+ def superuser?(%User{local: true, info: %User.Info{is_moderator: true}}), do: true
def superuser?(_), do: false
def avatar_url(user) do
# subject _> Where is this used?
end
- def superuser?(info), do: info.is_admin || info.is_moderator
-
def set_activation_status(info, deactivated) do
params = %{deactivated: deactivated}