Grants a project permission to install a package.
Run this statement from the project that owns the package (the resource provider project).
Syntax
allow project <project_name> to install package <package_name> [using label <number>];Parameters
| Parameter | Required | Description |
|---|---|---|
project_name | Yes | Name of the MaxCompute project to authorize. To find the project name, open the MaxCompute console and go to the Project management tab. |
package_name | Yes | Name of the package to share. To list packages in the current project, run show packages; on the MaxCompute client. |
number | No | Sensitivity level for label-based access control. The authorized project can only access package data whose sensitivity level is less than or equal to number. Defaults to 0 if not specified. |
Example
The following example is run in the test_project_a project. It grants test_project_b permission to install the datashare package.
-- Grant test_project_b permission to install the datashare package.
allow project test_project_b to install package datashare;After the statement runs successfully, test_project_b can install the package using INSTALL PACKAGE.
Package management workflow
ALLOW PROJECT is the authorization step in the package sharing workflow:
| Step | Statement | Description |
|---|---|---|
| 1. Create | CREATE PACKAGE | Create a package in the resource provider project. |
| 2. Add resources | ADD TO PACKAGE | Add the resources to share. |
| 3. Authorize | ALLOW PROJECT (this page) | Grant a project permission to install the package. |
| 4. Install | INSTALL PACKAGE | Install the package in the authorized project. |
Related statements
| Statement | Description |
|---|---|
| CREATE PACKAGE | Create a package. |
| DISALLOW PROJECT | Revoke a project's permission to install a package. |
| DESCRIBE PACKAGE | View the details of a package. |
| REMOVE FROM PACKAGE | Remove resources from a package. |
| DROP PACKAGE | Delete a package. |
| UNINSTALL PACKAGE | Uninstall a package from a project. |
| GRANT | Grant a user or role access to an installed package. |
| REVOKE | Revoke a user or role's access to a package. |
| SHOW | List packages created or installed in a project. |