# Restrict public viewing of user profile

**URL:** https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098
**Category:** Feature
**Created:** [10월 14, 2014, 8:39오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098 "2014-10-14T08:39:27Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![SylarRuby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sylarruby/32/35575_2.png) [@SylarRuby](https://meta.discourse.org/u/SylarRuby)
#### Post date: [10월 14, 2014, 8:39오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/1 "2014-10-14T08:39:27Z")

</div>

If this can be done with little coding until Discourse wants to add it to their new release then great, but can this be done? Changes in red: (Typo: “users must be logged in…”)

 ![](https://global.discourse-cdn.com/meta/original/3X/a/4/a400e7b993a32d358d1d0acf87e050314df32b4f.jpg)

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [10월 14, 2014, 9:20오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/2 "2014-10-14T09:20:37Z")

</div>

I’m all for this. We got a lot of what I call “Profile self-SPAMers” at vB i.e. join to put a link (or even only a non-link URL) and often a spiel in their Profile, then never participate in the forum. And the practice is continuing at Discourse.

Even though the vB Profiles were viewable only to those logged in (and no search bots could log in) that fact didn’t stop them from doing it. So I doubt if it would stop them at Discourse either.

But it might reduce it some.

Ideally such accounts would be auto-pruned after an arbitrary amount of time.

---

<div class="post-metadata">

### Author: ![SylarRuby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sylarruby/32/35575_2.png) [@SylarRuby](https://meta.discourse.org/u/SylarRuby)
#### Post date: [10월 14, 2014, 9:28오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/3 "2014-10-14T09:28:29Z")

</div>

@Mittineague I see where you are coming from. I was a vB admin but got to hate it. My reason is a bit different. I will have special users on my website (well…upcoming website) with private profile so I want to restrict non-members to view their profile without first being a member. The aim to get many registration.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [10월 14, 2014, 11:43오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/4 "2014-10-14T11:43:00Z")

</div>

So making tha ability to see registered members’ Profiles an incentive for anons to register?  
I’ve never thought of Profiles that way, but I guess they are Content after all.

---

<div class="post-metadata">

### Author: ![SylarRuby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sylarruby/32/35575_2.png) [@SylarRuby](https://meta.discourse.org/u/SylarRuby)
#### Post date: [10월 14, 2014, 11:56오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/5 "2014-10-14T11:56:11Z")

</div>

The forum I want will have details of IT Guys so to see their details… at least be a member first. 😉

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [10월 15, 2014, 12:34오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/6 "2014-10-15T00:34:25Z")

</div>

Just for the record, `/users/` is a disallowed path in robots.txt by default, so no user pages will ever be indexed by web crawlers.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [10월 15, 2014, 2:21오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/7 "2014-10-15T02:21:58Z")

</div>

[quote=“codinghorror, post:6, topic:21098, full:true”]  
Just for the record, /users/ is a disallowed path in robots.txt by default, so no user pages will ever be indexed by web crawlers.  
[/quote] – as long as they are crawlers that don’t ignore the robots.txt instructions.

Not exactly the same as"no" “ever” but close enough I guess.  
And now that email addresses are no longer available from Profiles there isn’t much incentive to ignore the robots.txt that I can think of.

---

<div class="post-metadata">

### Author: ![SylarRuby](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sylarruby/32/35575_2.png) [@SylarRuby](https://meta.discourse.org/u/SylarRuby)
#### Post date: [10월 15, 2014, 6:23오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/8 "2014-10-15T06:23:46Z")

</div>

So to my first question, can this be done or not? Or even to restrict the uploading of profile pictures or prevent non members from viewing the profile pictures. Those pictures can act as business cards.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [10월 15, 2014, 8:33오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/9 "2014-10-15T08:33:10Z")

</div>

new members can’t upload pictures - they find that out when they try, but it doesn’t take much to get to the basic Trust Level,  
I haven’t explored the Admin settings pages lately, or ever to any great extent, but IIRC at least the Trust Level requirements cat be set to other than the default.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [9월 11, 2015, 2:24오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/10 "2015-09-11T14:24:43Z")

</div>

Sorry to revive this, but the very same request has surfaced in our community. Are there any plans to implement this? Additionally, the /users page is visible to anonymous visitors (though not crawlers, but anyway) plus all the badges pages reveal a somehow complete list of discourse users, even if you do not have an account.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [9월 11, 2015, 7:01오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/11 "2015-09-11T19:01:44Z")

</div>

What’s your concern with allowing anon viewing? Or was it stated above?

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [9월 11, 2015, 7:58오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/12 "2015-09-11T19:58:19Z")

</div>

The concern in my community is that there is no option to restrict the “last post” or “joined” dates. Especially the first one can be a bit problematic - in our old forum software, one could choose to hide one’s online presence. Now, everyone can check when I last posted something online - even without registering.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9월 11, 2015, 8:01오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/13 "2015-09-11T20:01:59Z")

</div>

Do you mean “last visit date”? Your last post is always a public artifact unless your last post was in a PM.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [9월 11, 2015, 8:10오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/14 "2015-09-11T20:10:22Z")

</div>

Sure - actually both. „Last seen“ and „last post“. Of course you can search for the user’s posts - but for privacy-oriented communities, it would be nice to either restrict visibility of the user details. Either site-wide, or maybe on a per-user basis like “I want to share my details with everyone registered users only no one”. So you present yourself either like this:

 ![](https://global.discourse-cdn.com/meta/original/3X/5/a/5aa9934a37428ba26f3ac48fd2beba7498401a3f.png)

…or that:

 ![](https://global.discourse-cdn.com/meta/original/3X/4/1/41ff613e84efb722972e73aa84f746f400193fab.png)

If you post something, it’s clear that this is visible (unless you post in a hidden category). But if you only browse the site, we find it questionable that this data should be world-readable without a possibility to prevent it.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [9월 12, 2015, 6:14오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/15 "2015-09-12T18:14:33Z")

</div>

Uhm… I was just trying to put something together, but am stuck here: Why can’t I do this:

```plaintext

<script>
  Discourse.User.reopen({
    last_seen_at: function() {
        /* do clever stuff based on whether or not we're anonymous */
    }.property(),
  });
 </script>

```

…that doesn’t seem to get called at all. Any hints for the clueless?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [9월 12, 2015, 6:49오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/16 "2015-09-12T18:49:44Z")

</div>

It probably gets overridden by the actual data.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [9월 12, 2015, 7:56오후 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/17 "2015-09-12T19:56:36Z")

</div>

> [@riking](#):
>
> It probably gets overridden by the actual data.

Um… and who overwrites it with actual data? I didn’t really find out - I guess it’s coming somewhere from the underlying RestModel?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [9월 13, 2015, 12:51오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/18 "2015-09-13T00:51:58Z")

</div>

Due to the prototypical inheritance system, if the object has a property `last_seen_at` (the date) and its prototype (here, the class definition) has a property `last_seen_at` (your function), the object’s property gets used first.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [9월 13, 2015, 2:06오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/19 "2015-09-13T02:06:14Z")

</div>

If there was some sort of ‘logged-in’ class added to the body it would be easy to do with css.

---

<div class="post-metadata">

### Author: ![ColdSun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/coldsun/32/66668_2.png) [@ColdSun](https://meta.discourse.org/u/ColdSun)
#### Post date: [9월 13, 2015, 2:24오전 UTC](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098/20 "2015-09-13T02:24:05Z")

</div>

Those who are overly concerned with privacy and hiding a user’s recent activity are unlikely to settle for a CSS solution. It’d be simple to to just look into the source of the page and pull the data out for a specific user. CSS is _never_ a tool to provide security or privacy.

[다음 페이지](https://meta.discourse.org/t/restrict-public-viewing-of-user-profile/21098.md?page=2)
