talk icon indicating copy to clipboard operation
talk copied to clipboard

css class for logged in user-role

Open frisi opened this issue 4 years ago • 5 comments
trafficstars

would be nice to have a css class on one of the top level containers that reflects the user's role (anon, commenter, admin, staff, etc)

usercase: this would allow to hide the tab "Comments" for anonymous users and commenters whilst leaving the menu intact for others

.user-anon .coral-tabBar,
.user-commenter .coral-tabBar {
  display: none;
}

frisi avatar Jan 25 '21 17:01 frisi

We actually already have that! That's the .coral-authenticated and .coral-unauthenticated classes.

wyattjoh avatar Feb 01 '21 17:02 wyattjoh

ah, i see. the reason i could not find it is that it has been placed inside section#tabPane-COMMENTS div instead of div#app or the body.

the current solution does not allow to style/hide the main navigation section based on whether the user is logged in or not.

@wyattjoh would you please consider to re-open the issue and discuss this?

frisi avatar Feb 02 '21 10:02 frisi

Which part of the main navigation are you attempting to style?

wyattjoh avatar Feb 02 '21 19:02 wyattjoh

thanks @wyattjoh

our usecase would be to hide the main navigation for unauthenticated users (as there is only the comment tab for them anyway)

frisi avatar Feb 03 '21 15:02 frisi

@cvle do you think we could move the .coral-authenticated and .coral-unauthenticated classes higher in the tree to accommodate this?

wyattjoh avatar Feb 03 '21 16:02 wyattjoh