Lakehouse User Authorization Getting Started Guide
1. Introduction
Singdata Lakehouse adopts a flexible and powerful permission management system, implementing fine-grained data access management through Role-Based Access Control (RBAC). This guide combines theoretical knowledge with practical operations to detail the user authorization management process in Lakehouse, helping administrators efficiently manage data resource access permissions.
This guide also validates the process through a hands-on experiment.
2. User Management System Architecture
2.1 User Hierarchy
The Singdata Lakehouse user management system is divided into two levels:
- Global Users: Users managed globally on the Singdata platform. Each user has an independent identity with a unique username and password.
- Workspace Users: Users within a specific workspace in a specific Lakehouse service instance, who can only be granted corresponding roles and permissions within the workspace.
2.2 User Types
- Regular Users: Represent actual personnel within the enterprise, used for daily data query, analysis, and management operations.
- Service Users: Special users that serve automation processes or system-level operations. Web login is not allowed, but they can be used for JDBC connections or scheduled tasks.
3. Role Management Basics
3.1 Role Definition and Types
A role is an authorization management tool that consolidates multiple permission points together and then grants them to one or more users. Roles in Lakehouse are divided into two types:
- Built-in Roles: System-automatically configured roles that cannot be deleted, can have their permissions modified*, and can be directly granted to users.
- Custom Roles: Roles created by users based on business needs, with flexible permission configuration and maintenance.
*Note: Among built-in roles, workspace_admin and instance_admin do not allow permission modification. Other built-in roles can have their permissions modified.
3.2 Role Levels
- Instance Role: Used for global governance of instance-level resources and operations, or permission grants across multiple workspaces.
- Workspace Role: Acts on objects within a specific workspace, such as schemas, tables, virtual clusters, etc.
4. Practical Operation Steps
4.1 User Management Operations
1. Add a User to a Workspace
2. View Users in the Workspace
3. Remove a User from the Workspace
4.2 Role Management Operations
1. Create a Custom Role
2. View Roles
3. Delete a Role
4.3 Permission Granting Operations
1. Grant Schema-level Permissions
2. Grant Table-level Permissions
3. Grant View Permissions
4. Grant a Role to a User
4.4 Permission Revocation Operations
1. Revoke Object Permissions
2. Revoke a Role from a User
5. Permission Verification and Auditing
5.1 Query User Permissions
5.2 Query Role Permissions
5.3 Query Granted Permissions on an Object
5.3 Query Current User
6. Complete Lab Case
The following is a complete user authorization management practice case, covering the full workflow from creating users to cleaning up the environment:
6.1 Create Test Users
6.2 Create Test Environment
6.3 Create and Grant Roles
6.4 Verify Permission Configuration
6.5 Environment Cleanup
7. Best Practices and Notes
7.1 User Management Best Practices
- Understand User Hierarchy: Distinguish between global account users and service instance users, and clearly understand the actual role of
CREATE USERin a workspace. - Check Before User Creation: Use
SHOW USERSto confirm whether a user already exists in the workspace to avoid redundant operations. - Standardized Naming for Service Users: For service users of automation processes, it is recommended to use specific prefixes for naming, such as
svc_, for easy distinction.
7.2 Role Management Best Practices
- Follow the Principle of Least Privilege: Role permission design should follow the principle of least privilege, granting only necessary permissions.
- Hierarchical Role Design: Design a hierarchical role structure to facilitate permission management and maintenance.
- Role Naming Conventions: Use standardized naming conventions, such as
[business_domain]_[function]_roleformat.
7.3 Permission Auditing and Maintenance
- Regular Auditing: Regularly review user permissions and role assignments to ensure compliance with security requirements.
- Permission Change Records: Record important permission change operations for traceability.
- Test Verification: After permission changes, use the relevant user identity to test and verify that permissions have taken effect correctly.
8. FAQ
Q1: Why is no password required when creating a user in a workspace?
A1: This is because when the CREATE USER command is executed in a workspace, it actually adds a user already existing in the service instance to the current workspace. It is an authorization operation, not actual user creation. The user's identity verification information (such as password) is managed at the global account level.
Q2: After a user is removed from one workspace, does it affect their access in other workspaces?
A2: No. The DROP USER command only removes the user from the current workspace. It does not affect the user's permissions and access in other workspaces, nor does it delete the user's information in the service instance.
Q3: How to view all authorization details for a specific object (such as a table)?
A3: Use the SHOW GRANTS ON <object_name> statement. You can also query the information schema.
Q4: What is the difference between built-in roles and custom roles?
A4: Built-in roles are automatically configured by the system, cannot be deleted, and are suitable for common scenarios. Custom roles are created by users with flexibly configurable permissions, suitable for specific business needs.
Q5: Can a user have multiple roles simultaneously?
A5: Yes. A user can be granted multiple roles and will obtain the union of all permissions from those roles.
9. Summary
The Singdata Lakehouse user authorization management system is both powerful and flexible. Through the Role-Based Access Control model, fine-grained permission management can be achieved. This guide combines theoretical explanations with practical operations, comprehensively introducing the complete workflow from user management to permission auditing, helping administrators manage data access security more efficiently.
In practice, you should fully understand the user hierarchy, properly plan role and permission architectures, and conduct regular permission audits to ensure data security while improving authorization management efficiency.
Reference Documents
