Announcement

Collapse
No announcement yet.

make panel only visible if current user is assigned user (account)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • make panel only visible if current user is assigned user (account)

    Hello,

    i have a question and i hope someone can help me. i would like to make a panel visible only if the current user who is logged in is the same as the assigned user of the account. how can i do this. I Try ifThenElse(assignedUser.name==assignedUserName, controlfield=1, controlfield=null); in the entitymanager for accounts ...and then i make the panel visible if controlfield is 1... The controlfield is a boolfield. thank you

    Best regards
    Last edited by Mastelui; 09-24-2018, 08:51 AM.

  • #2
    this is better to implement with a development


    override afterRender method
    hidePanel(panelName);
    if (this.model.get('assignedUserId') == this.getUser().id) {
    showPanel(panelName);
    }

    Comment


    • #3

      Thank you so much tanya,

      i use

      if (this.model.get('assignedUserId') != this.getUser().id) {

      this.$el.find('.field[data-name="xxx"]').addClass("hidden");

      }


      but now i have a question about user roles. can i make the field visible if the logged-in user are in a special role group.

      Thank you for your support :-)

      Comment


      • #4
        you can hide fields with Role Manager.
        Administration > Roles > role > Field Level

        Comment


        • punkyard
          punkyard commented
          Editing a comment
          thanks, it works fine with a simple role
          the "trunked" page displays a small pop-up though, disgraceful: "Error 403: Access denied"

          In my situation, i'm hiding the account of Property in RealEstate. This popup shows for a few seconds on each Property page when the user doesn't have the permission to see the Account ..

          the other option was to block the access to the account page, but instead of suppressing the link on the Account name, it takes the user to a white page saying Error 404, with no navigation option .. that's a pity for simple users ..
      Working...
      X