From 9d1381c33bfa25ee1c6b88e094c8539305c075bd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Aug 2013 15:08:55 +0530 Subject: [PATCH] [fix] [minor] do not allow website user access to app --- public/js/wn/app.js | 3 +-- webnotes/profile.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/js/wn/app.js b/public/js/wn/app.js index 09d93a47ec..83196822ce 100644 --- a/public/js/wn/app.js +++ b/public/js/wn/app.js @@ -28,8 +28,7 @@ wn.Application = Class.extend({ callback: function(r, rt) { wn.provide('wn.boot'); wn.boot = r; - if(wn.boot.profile.name=='Guest' || - (wn.boot.profile.roles.length===1 && wn.boot.profile.roles[0]==="All")) { + if(wn.boot.profile.name==='Guest' || wn.boot.profile.user_type==="Website User") { window.location = 'index.html'; return; } diff --git a/webnotes/profile.py b/webnotes/profile.py index 1b689e60a7..81848ab988 100644 --- a/webnotes/profile.py +++ b/webnotes/profile.py @@ -133,7 +133,7 @@ class Profile: def load_profile(self): d = webnotes.conn.sql("""select email, first_name, last_name, - email_signature, background_image + email_signature, background_image, user_type from tabProfile where name = %s""", self.name, as_dict=1)[0] if not self.can_read: