Display logo based on which group logged in user is part of | Community
Skip to main content
armanm32055672
Level 2
February 1, 2018
Solved

Display logo based on which group logged in user is part of

  • February 1, 2018
  • 1 reply
  • 998 views

Hi,

I have a component that displays a logo on a page, I need to be able to dynamically change this logo depending on what group the user is a member of. For example let's say we have two users, James & Paul and they belong to two separate groups. James is in group A and Paul is is group B, I want to only show img for group A and a different img src if they are in group B.

Sudo:

<img class="ui image"

                  src="${

                    (

                      (user group == 'group A') ? ('show logo for group A')

                       :(

                          (user group == 'group B') ? ('show logo for group A')

                          :(

                              'default logo'

                           )

                        )

                     )

}"/>                                

How can I do this? I am having some trouble trying to reference user's group, I can do it with the name but need to be able to do it with it's group. 

-Arman

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

Jackrabbit API provide method ismemberof which can you tell which group is current user part of.

https://jackrabbit.apache.org/api/2.8/org/apache/jackrabbit/api/security/user/Authorizable.html#memberOf()

Also worth taking a look at

https://jackrabbit.apache.org/oak/docs/security/user.html

1 reply

edubey
edubeyAccepted solution
Level 10
February 1, 2018

Jackrabbit API provide method ismemberof which can you tell which group is current user part of.

https://jackrabbit.apache.org/api/2.8/org/apache/jackrabbit/api/security/user/Authorizable.html#memberOf()

Also worth taking a look at

https://jackrabbit.apache.org/oak/docs/security/user.html