[SERVER-72477] Rules >> Apply When: "%%user" causing server error Created: 03/Jan/23  Updated: 03/Jan/23  Resolved: 03/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: kulXtreme N/A Assignee: Chris Kelly
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

```

{   "%%user.custom_data.is_admin": true }

```

 

If the user has set is_admin in custom data, this expression should be evaluated true, but it is causing server error in MongoDB Atlas.



 Comments   
Comment by Chris Kelly [ 03/Jan/23 ]

Thanks for clarifying!

Atlas App Services rules expressions are an Atlas component, so we are unable to troubleshoot issues with it here.

The SERVER project is for bugs and feature suggestions for the MongoDB server. To inform our Atlas team of issues you are having or feature requests you'd like to suggest, please reach out to the Atlas support team. You can do this by clicking the round green button at the bottom right of the cluster view page in Atlas.

Alternatively, you can also ask our community for help by posting on the MongoDB Developer Community Forums.

I'm going to close this ticket for now, but if the discussion there leads you to suspect a bug in the MongoDB server, then we'd want to continue investigating it as a possible bug here in the SERVER project. 

Regards,

Christopher

Comment by kulXtreme N/A [ 03/Jan/23 ]

And also it is not documented using %%user.custom_data there https://www.mongodb.com/docs/atlas/app-services/rules/expressions/

Comment by kulXtreme N/A [ 03/Jan/23 ]

It is issue at setting rules for collection at realm.mongodb.com, communication with database is through javascript using realm.

Comment by Chris Kelly [ 03/Jan/23 ]

kulxtreme@gmail.com,

Can you clarify if you are reporting an issue with Atlas App Services (or Realm)? Additionally, can you please provide additional information demonstrating the error you're seeing? (A screenshot or copy/paste of the full output would do)

Christopher

 

 

Comment by kulXtreme N/A [ 03/Jan/23 ]

In this case, it will not cause server error, but it will not do its job:

```

{   "user.custom_data.is_deactivated": false }

```

Comment by kulXtreme N/A [ 03/Jan/23 ]

........has set is_admin to true......

Generated at Thu Feb 08 06:21:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.