initial look at indicating if user is not the owner
this does not fully work as the server does not update `isOwner` in the client when the user authenticates.
This commit is contained in:
parent
f7f34b2223
commit
d84a282bb3
|
@ -51,7 +51,13 @@ update_footer = (ownerName, isAuthenticated) ->
|
|||
$('footer > #security').empty()
|
||||
|
||||
if isAuthenticated
|
||||
$('footer > #security').append "<a href='#' id='logout' class='footer-item' title='Sign-out'><i class='fa fa-unlock fa-lg fa-fw'></i></a>"
|
||||
if isOwner
|
||||
logoutTitle = "Sign-out"
|
||||
logoutIconClass = ''
|
||||
else
|
||||
logoutTitle = "Not Owner : Sign-out"
|
||||
logoutIconClass = 'notOwner'
|
||||
$('footer > #security').append "<a href='#' id='logout' class='footer-item' title='#{logoutTitle}'><i class='fa fa-unlock fa-lg fa-fw #{logoutIconClass}'></i></a>"
|
||||
$('footer > #security > #logout').click (e) ->
|
||||
e.preventDefault()
|
||||
myInit = {
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
color: floralwhite;
|
||||
}
|
||||
|
||||
#isOwner {
|
||||
color: green;
|
||||
.notOwner {
|
||||
transform: rotate(20deg);
|
||||
}
|
||||
|
|
|
@ -133,6 +133,7 @@ module.exports = exports = (log, loga, argv) ->
|
|||
else
|
||||
try
|
||||
idProvider = _.head(_.keys(req.session.passport.user))
|
||||
console.log 'idProvider: ', idProvider
|
||||
switch idProvider
|
||||
when 'github', 'google', 'twitter'
|
||||
if _.isEqual(owner[idProvider].id, req.session.passport.user[idProvider].id)
|
||||
|
|
Loading…
Reference in New Issue