cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Java exception

AC_9552412
10-Marble

Java exception

Hello, I have the following error (JavaException: com.thingworx.common.exceptions.InvalidRequestException: Language preferences can be changed only by the user or an administrator ) when trying to change the language of a user. The service is in a thing for which all users have visibility but only the System user has permissions to run it. How can I solve it?

 

1 ACCEPTED SOLUTION

Accepted Solutions
TonyZhang
13-Aquamarine
(To:AC_9552412)

@AC_9552412 

Are you trying to invoke a function called SetLanguagePreferences on user?

I tried calling this function in custom JS service with non-admin user and get the same error message except for not a JavaException (not sure how you are changing the user language exactly)

TonyZhang_1-1694675986975.png

TonyZhang_0-1694675691591.png

You will need to add the service executor to a system-defined user group: SecurityAdministrators to allow the user to access service SetLanguagePreferences.

See Help Center > Security Administrators Group section

 

View solution in original post

2 REPLIES 2
PaiChung
22-Sapphire I
(To:AC_9552412)

The users themselves have the permission to change the language preference.

Is it the actual user who is invoking this for themselves or are you trying to set it for a user?

I haven't had to deal with this for a while, but if you are doing it with the actual user and running into this issue,

then I think you can safely assign 'users' to that specific service.

TonyZhang
13-Aquamarine
(To:AC_9552412)

@AC_9552412 

Are you trying to invoke a function called SetLanguagePreferences on user?

I tried calling this function in custom JS service with non-admin user and get the same error message except for not a JavaException (not sure how you are changing the user language exactly)

TonyZhang_1-1694675986975.png

TonyZhang_0-1694675691591.png

You will need to add the service executor to a system-defined user group: SecurityAdministrators to allow the user to access service SetLanguagePreferences.

See Help Center > Security Administrators Group section

 

Top Tags