Hexagon Geospatial
MENU

GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 170
Registered: ‎07-07-2016
Accepted Solution

How to make TextField editable for user role?

Hi,

 

I have two user roles: EDITOR and READER.

EDITOR role can edit my TextField, while READER role can only read it.

What is the simplest way to make it in GMSC? 

Staff
Posts: 966
Registered: ‎10-19-2015

Re: How to make TextField editable for user role?

hi,

 

since ROLE is available only on authorization property you may apply this simple workaround: define the field twice:

  • the first one is editable with authorization applied
  • the second one is not editable and hidden or shown based on availability of the first one (by default hidden, shown only if the first one is not defined)

so for instance in formsettings:

<FormField name="AUTHEDIT" persisted="false" type="textfield" datatype="string"   authorization="ROLE[myRole]"/>				
<FormField name="NOAUTHVIS" persisted="false" type="textfield" datatype="string"  editable="false" visible="hidden"/>				

together with the following custom script:

IG.vent.on('form:ready', function (context) {    
	if (typeof IG.getItemById('AUTHEDIT') == 'undefined') {
		IG.getItemById('NOAUTHVIS').show();
	}
});

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.