feat(profile): Don't allow non-guest users to edit their profile
This commit is contained in:
parent
c609cd0ace
commit
f10b13328f
|
@ -69,5 +69,9 @@ var config = {
|
||||||
'During that time service will not be available. ' +
|
'During that time service will not be available. ' +
|
||||||
'Apologise for inconvenience.',*/
|
'Apologise for inconvenience.',*/
|
||||||
disableThirdPartyRequests: false,
|
disableThirdPartyRequests: false,
|
||||||
minHDHeight: 540
|
minHDHeight: 540,
|
||||||
|
// If true - all users without token will be considered guests and all users
|
||||||
|
// with token will be considered non-guests. Only guests will be allowed to
|
||||||
|
// edit their profile.
|
||||||
|
enableUserRolesBasedOnToken: false
|
||||||
};
|
};
|
||||||
|
|
|
@ -65,9 +65,12 @@ class TokenData{
|
||||||
* @param {string} the JWT token
|
* @param {string} the JWT token
|
||||||
*/
|
*/
|
||||||
constructor(jwt) {
|
constructor(jwt) {
|
||||||
|
this.isGuest = true;
|
||||||
if(!jwt)
|
if(!jwt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.isGuest = config.enableUserRolesBasedOnToken !== true;
|
||||||
|
|
||||||
this.jwt = jwt;
|
this.jwt = jwt;
|
||||||
|
|
||||||
//External API settings
|
//External API settings
|
||||||
|
|
|
@ -367,7 +367,8 @@ function registerListeners() {
|
||||||
UI.addListener(UIEvents.TOGGLE_CONTACT_LIST, UI.toggleContactList);
|
UI.addListener(UIEvents.TOGGLE_CONTACT_LIST, UI.toggleContactList);
|
||||||
|
|
||||||
UI.addListener( UIEvents.TOGGLE_PROFILE, function() {
|
UI.addListener( UIEvents.TOGGLE_PROFILE, function() {
|
||||||
UI.toggleSidePanel("profile_container");
|
if(APP.tokenData.isGuest)
|
||||||
|
UI.toggleSidePanel("profile_container");
|
||||||
});
|
});
|
||||||
|
|
||||||
UI.addListener(UIEvents.TOGGLE_FILM_STRIP, UI.handleToggleFilmStrip);
|
UI.addListener(UIEvents.TOGGLE_FILM_STRIP, UI.handleToggleFilmStrip);
|
||||||
|
|
Loading…
Reference in New Issue