polyspace-access -set-role
Assign role to user or group
Description
The system command polyspace-access -set-role
assigns a role to a user or group name for the specified project or folder in Polyspace®
Access™.
polyspace-access -set-role
assigns a role <role>
-user <username>
-group <groupname>
-project-path <folderPathOrProjectPath>
-host <hostname>
[login options
] [output options
]<role>
to <username>
or
<groupname>
for the specified project or project folder. A user or
group role set for a project folder applies to all project results under that folder. All
users in a group inherit the role assigned to their parent group. You specify the project
using either the full path in Polyspace
Access or the last run ID. To get the paths to projects and their last run IDs, use
polyspace-access
command with the polyspace-access -list-project
command.
Examples
Authorize select team members to view results uploaded to Polyspace Access.
Set roles for users jsmith
and rroll
and the
group Authorized Users
, authorizing them to access the project folder
public\restrictedProject
as contributors.
polyspace-access -set-role contributor ^ -user jsmith -user rroll -group "Authorized Users" -project-path public\restrictedProject ^ -host myAccessServer -port 1234
restrictedProject
.Remove roles the user mjones
and the group
Public
for the project
folder.
polyspace-access -host myAccessServer ^ -port 1234 -unset-role -user mjones -group "Public" -project-path public\restrictedProject
For more information on managing project permissions in Polyspace Access, see Manage Project Permissions.
Input Arguments
Manage User Permissions
Level of access to project folder and results for a user, specified as one of these values:
owner
— User can move, rename, or delete a specified project folder or results and review its contents.contributor
— User can review contents of a specified project folder or results. User can upload results to specified folders or projects.reviewer
— User can review content of a specified project folder or results.reader
— User can view projects in the Project Explorer and the dashboards of specified project folder or project.forbidden
— User cannot access specified project folder or results. Set this role to restrict the access of a user to a set of project results inside a project folder that is accessible to the user.
Example: contributor
Polyspace Access username, specified as a string.
Example: -user caguilera
Polyspace Access group name, specified as a string.
Example: -group "Group UI team"
Path of a project folder or project results, specified as a string. When
<folderPathOrProjectPath>
is the path to a project folder, the
user role you set applies to all subfolders and project results under that folder. If
the path name includes spaces, use double quotes. To get the project folder or results
path, use polyspace-access -list-project
.
Example: -project-path "public/Examples/Bug_Finder_Example (Bug
Finder)"
Example: -project-path public
Connection Configuration
Polyspace Access machine hostname
that you specify in the URL
of the Polyspace
Access interface, such as
https://
.
If you are unsure about which hostname to use, contact your Polyspace
Access administrator. hostname
:portNumber
/metrics/index.html
You must specify a hostname with all polyspace-access
commands,
except the -generate-migration-commands
and
-encrypt-password
commands.
Example: -host myAccessServer
Port number that you specify in the URL of the Polyspace
Access interface, such as
https://
.
If you are unsure about which port number to use, contact your
Polyspace
Access administrator.hostname
:portNumber
/metrics/index.html
HTTP protocol used to access Polyspace
Access, specified as http
or
https
.
Full path to the text file where you store your login credentials. Use this option if you use a command that requires your Polyspace Access credentials in a script but you do not want to store your credentials in that script. While the script runs, someone inspecting currently running processes cannot see your credentials.
You can store only one set of credentials in the file, either as
-login
and -encrypted-password
entries on separate lines, for instance:
-login jsmith -encrypted-password LAMMMEACDMKEFELKMNDCONEAPECEEKPL
-api-key
entry:-api-key keyValue123
login.txt
in Linux®, use this
command:chmod go-rwx login.txt
API key you use as a login credential instead of providing your login and encrypted password. To assign an API key to a user, see Configure User Manager or contact your Polyspace Access administrator.
Use the API key if you use a command that requires your Polyspace Access login credentials as part of an automation script with a CI tool such as Jenkins®. If a user updates their password, you do not need to update the API key associated with that user in your scripts.
It is recommended that you store the API key in a text file and pass
that file to the command by using the -credentials-file
option.
Login username that you use to interact with Polyspace Access.
Use the options -login
and
-encryped-password
together. If you do not use
these two options together, you are prompted to enter your credentials
at the command line, unless you use -api-key
.
Login password you use to interact with Polyspace
Access. <ENCRYPTED_PASSWORD>
is the output
of the
command.polyspace-access -encrypt-password
Use the options -login
and
-encryped-password
together. If you do not use
these two options together, you are prompted to enter your credentials
at the command line, unless you use the -api-key
option.
Number of times the polyspace-access
command
retries to upload results when you upload from a client machine to the
server machine that hosts Polyspace
Access before failing. Specify this option to retry the upload
command in the event of sporadic network outages. The command waits 10
seconds between retries.
Full path to command outputs.
Path to the folder for storing temporary files generated by
polyspace-access
commands. The default folder
path depends on your platform:
Windows —
C:\Users\%username%\AppData\Local\Temp\ps_results_server
Linux —
tmp/ps_results_server
File path where you store the command output log. By default the command does not generate a log file.
Version History
Introduced in R2019a
MATLAB Command
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)