mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 01:24:34 +08:00
681ff74cb8
This reverts commit 7ec34b205a
.
32 lines
728 B
JavaScript
32 lines
728 B
JavaScript
/**
|
|
This mixin provides a `currentUser` property that can be used to retrieve information
|
|
about the currently logged in user. It is mostly useful to controllers so it can be
|
|
exposted to templates.
|
|
|
|
Outside of templates, code should probably use `Discourse.User.current()` instead of
|
|
this property.
|
|
|
|
@class Discourse.HasCurrentUser
|
|
@extends Ember.Mixin
|
|
@namespace Discourse
|
|
@module HasCurrentUser
|
|
**/
|
|
Discourse.HasCurrentUser = Em.Mixin.create({
|
|
|
|
/**
|
|
Returns a reference to the currently logged in user.
|
|
|
|
@method currentUser
|
|
@return {Discourse.User} the currently logged in user if present.
|
|
*/
|
|
currentUser: function() {
|
|
return Discourse.User.current();
|
|
}.property().volatile()
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|