To grant read-only access to views for guest users in a Canvas app, you can follow these steps:
- Create a custom role specifically for granting read-only access to views.
- Grant necessary permissions to the role: Grant the necessary permissions to the
CustomReadOnlyRole
for accessing the views. Use theGRANT SELECT
statement to provide read-only access to the views. - Assign the role to the guest user: Once the role is created and permissions are granted, you need to assign the
CustomReadOnlyRole
to the guest user you want to provide read-only access to. Use theALTER ROLE
statement to assign the role to the user.
CREATE ROLE [CustomReadOnlyRole];
GRANT SELECT ON [schema].[view_name] TO [CustomReadOnlyRole];
ALTER ROLE [CustomReadOnlyRole] ADD MEMBER [guest_user];