Previous Next JavaScript must be enabled to correctly display this content

## Namespace Privileges and Authorization

You can add multiple namespaces to your store, create tables within them, and assign specific permissions to users, allowing them to access specific namespaces and tables. Additionally, you can manage access control by authorizing which users can create and drop namespaces and indexes or modify any data within each namespace, providing greater flexibility and data handling.

To understand more about the user and role privileges, see Namespace Privileges and Permissions (Table 4-1) in Java Direct Driver Developer's Guide.

Before granting access to namespaces, create the following using SQL Shell.

First, create a user:

    CREATE USER John IDENTIFIED BY "NewPwd123!!"

Where,

1. John is the user_name
2. NewPwd123!! is the password

Next, grant `dbadmin` privilege to user, John

    GRANT DBADMIN TO USER John

Where, `DBADMIN` is a built-in role. See, Built-in Roles, for more predefined roles.

And now you can grant the user, John, to create tables in the `ns1` namespace.

    GRANT CREATE_TABLE_IN_NAMESPACE ON NAMESPACE ns1 TO John

Now, grant permission to the user to create an index on any table in `ns1` namespace.

    GRANT CREATE_INDEX_IN_NAMESPACE ON NAMESPACE ns1 TO John

Also, you can now grant permission to user to delete items in `ns1` namespace.

    GRANT DELETE_IN_NAMESPACE ON NAMESPACE ns1 TO John