layout manager fields for non-admin users?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elbowprogrammer
    Member
    • Jan 2016
    • 58

    layout manager fields for non-admin users?

    I create some custom fields from the from an existing entity. I added the fields to the layout. My question is, is it possible to make these fields visible only for non-admin users?
  • yuri
    Member
    • Mar 2014
    • 8698

    #2
    In detail and edit view classes you can write
    PHP Code:

    setup
    : function () {
        
    Dep.prototype.setup.call(this);
        if (
    this.getUser().isAdmin()) {
            
    this.hideField('myField');
        } else {
            
    this.showField('myField');
       }

    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Ryan_WHR
      Member
      • Feb 2016
      • 37

      #3
      how would i add this to a layout
      could i add it to say-- custom/Espo/Custom/Resources/metadata/i18n/en_US/Contact.json

      could you give me a example

      Comment

      • yuri
        Member
        • Mar 2014
        • 8698

        #4
        Classes like client/src/views/email/record/detail.js
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...