##// END OF EJS Templates
fixed anonymous access bug.
marcink -
r686:ff6a8196 beta
parent child Browse files
Show More
@@ -209,8 +209,6 b' def get_user(session):'
209 :param session:
209 :param session:
210 """
210 """
211 user = session.get('rhodecode_user', AuthUser())
211 user = session.get('rhodecode_user', AuthUser())
212
213
214 #if the user is not logged in we check for anonymous access
212 #if the user is not logged in we check for anonymous access
215 #if user is logged and it's a default user check if we still have anonymous
213 #if user is logged and it's a default user check if we still have anonymous
216 #access enabled
214 #access enabled
@@ -219,6 +217,7 b' def get_user(session):'
219 if anonymous_user.active is True:
217 if anonymous_user.active is True:
220 #then we set this user is logged in
218 #then we set this user is logged in
221 user.is_authenticated = True
219 user.is_authenticated = True
220 user.user_id = anonymous_user.user_id
222 else:
221 else:
223 user.is_authenticated = False
222 user.is_authenticated = False
224
223
@@ -151,6 +151,11 b' class UserModel(object):'
151 present in database
151 present in database
152 :param user:
152 :param user:
153 """
153 """
154
155 if not hasattr(user, 'user_id') or user.user_id is None:
156 raise Exception('passed in user has to have the user_id attribute')
157
158
154 log.debug('filling auth user data')
159 log.debug('filling auth user data')
155 try:
160 try:
156 dbuser = self.get(user.user_id)
161 dbuser = self.get(user.user_id)
General Comments 0
You need to be logged in to leave comments. Login now