Read-only fields in the user profile widget

Peter Bishop
Kilo Expert

I'd like to change some of the fields in the user profile widget to read-only while retaining the look-and-feel of the output. I've cloned the OOB user_profile widget and made the following change:

<div ng-repeat="fieldModel in getSysUserModelFields()">
  <div class="list-group-item">
    <div>
      <sp-editable-field block="true" table="sys_user" editable-by-user="false" table-id="data.sysUserID" field-model="fieldModel"></sp-editable-field>
    </div>
  </div>
</div>

which works fine in that the fields can no longer be changed. However where a field has no data entered I don't get the header. For example when editable I get:

find_real_file.png

but when read-only I get:

find_real_file.png

Is there a way to display headers for all of the fields returned by getSysUserModelFields(), even if the option to edit them is set to false?

Also is there a way to selectively make a field read-only? For example you change change your phone number but not your email address?

Thanks.

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

 

Did you try CanWrite and CanRead Concept in portal.

 

current.canWrite is a good option.


Thanks,
Ashutosh Munot

denis hoffmann
Kilo Guru

Hi Peter,

If end users with no role shouldn't be allowed to change some fields ( on Portal and Back Office)
Did you try to set these fields  as "Read Only" with ACLs, without any change on the widget part ?

Regards,
Denis

I always seem to over complicate things.  This made it really easy for me. 

 

Thanks,

Donald

Can you please explain how this was achieved through ACL