Hi developers!
While developing web apps the security practice I consider safe and convenient is to create a special Role (e.g. equal application name) which contains security resources which application will need (SQL tables, priviledges, database access, etc) and assign it to the Web Application.
So the user gets this role once it loggs in to the application (via password, no password or delegated).
Convenient, right?
So, the question is, when I deploy the app as an IPM module what should I put as a database access?
For example I develop the app in the USER namespace so I list the access to %DB_USER in Role's resources and the export(D ##class(Security.Roles).Export("/home/irisowner/dev/roles.xml",,"lovable",,1) looks like:
<?xml version="1.0" encoding="UTF-8"?>
<RolesExport>
<Roles>
<Name>lovable</Name>
<Version>4</Version>
</Roles>
<Roles>
<GrantedRoles>
<GrantedRolesItem>%DB_USER</GrantedRolesItem>
</GrantedRoles>
<Name>lovable</Name>
<Version>4</Version>
</Roles>
<SQLPrivileges>
<Namespace>USER</Namespace>
<SQLObject>1,dc_Sample.Person</SQLObject>
<Privilege>s</Privilege>
<Grantee>lovable</Grantee>
<Grantor>SuperUser</Grantor>
<Grantable>0</Grantable>
</SQLPrivileges>
<SQLRoleGrantOption>
<UserOrRole>lovable</UserOrRole>
<RoleGranted>%DB_USER</RoleGranted>
<Grantable>0</Grantable>
</SQLRoleGrantOption>
</RolesExport>
But the app could be installed in any database, right? Which resource should I provide? Maybe %DB_DEFAULT (What does it mean BTW)? Any ideas?