Instructor: 00:00 To get more user information from Domino, including what roles the user has, I find the easiest way is to create a simple page. I'm using a page because a form it has new fields required on this. We're going to call the page User. I'm storing this page inside my demo database.
00:16 The first thing we want to do is change the MIME type for the page so that it returns JSON data. Then, we're going to use simple computed values. We'll start with a user object. We'll use a string inaudible here. This object will have two properties. It'll have the user name, and for this computed value, we'll use a simple @UserName, and we'll wrap it with a @name so we get the common name.
00:53 Then, our second property will be roles. This could be a multivalue, so it's going to potentially be an array. We want to remove the square brackets and the dollar inaudible that Domino will automatically send. We'll start with a temporary variable. We'll add a trim and an @replace substring.
01:13 We're going to work on user roles. We'll remove one square bracket, the other square bracket, and $$ workline, and we're going to replace those with empty quotes. If we don't have any roles, then we want to return a blank value, else we want to implode them and wrap them in string quotes.
02:00 I sign in. I then get back the JSON data that we've defined using the computed values. My test user actually has those roles. They're listed here in the ACL. Let's go forward and use those within our application.