Thank you, @Tani Frankel !

This is useful through years!

Just adding here the snippet to add role to a user:

ClassMethod AddRoleToUser(user = "CSPSystem", role = "DB_USER_Read") As %Status

{

// Change to the %SYS namespace.

new $NAMESPACE

set $NAMESPACE="%SYS"



set status=##class(Security.Users).Get(user, .MyUserProps)

set $p(MyUserProps("Roles"),",",*)=role

set status=##class(Security.Users).Modify(user,.MyUserProps)



// Announce success.

if $$$ISOK(status) {

write !, "Roles for the user "_user_" were successfully modified."

}

Quit status

}

Thanks, Enrico! Namespace, of course! I prefer usualy the simplicity of having one Database in one Namespace if possible.

Your great answer doesn't answer though my question. The situation is: I deploy a package, which contains:

persistent class(es), data(generated ok, but could be different), WebApp (aka CSP app). I deploy a Role also, which will be used by the WebApp. Role need the access to database... Here is my question, which database resource do I provide to the role as I don't know the namespace the package will be installed by a potential user? 

Great article, @Timothy Leavitt ! I think it is questionable the recommendation not to use AI for the spheres you are not familiar with.

E.g. I'm not a frontend developer at all but the AI capabilities in AI generation are awesome and give me an opportunity to immediately have an MVP in frontend and also to build prototypes fast which was impossible in a preAI times.