user = compiler.UserInfo() returns the details
of a user logged in to the machine running a desktop version of MATLAB® or details of a user logged in to MATLAB
Web App Server™.
user =
UserInfo with properties:
UserID: 'someid'
DisplayName: <missing>
Groups: <missing>
Domain: 'SOME_DOMAIN'
Create the userinfo.json file in the
webapps_private folder on MATLAB
Web App Server.
{
"version": "1.0.0",
"userInfo.doc": "Property values to be fetched during login from IdP",
"userInfo": {
"UserID": "upn",
"DisplayName": "displayName",
"Groups": "groups",
"LastName": "surname",
"Email": "mail"
},
"appAccess.doc": "Policy for allowing access to user properties within an app or group of apps",
"appAccess": {
"BloodPressure": ["UserID","Email"],
"Mortgage": ["UserID","LastName"],
"Mystery": ["UserID","Email","WebAppsRole","WebAppsDisplayName"]
}
}
Then
use the compiler.UserInfo function within your app to customize the
app.
function startupFcn(app)
try
user = compiler.UserInfo();
catch me
error(me.message);
returnendif ~ismissing(user.UserID)
% customizing app codeendif isprop(user, 'Email')
% customizing app codeend
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.