Toad World® Forums

Give permissions to DB2 roles, not groups



Is there a way in TDM to grant permissions to entities to DB2 roles rather than groups? We only use roles for security.

I’m using TDM 5.2, DB2 9.7.




Hi Nick,

Roles are not currently supported but we do have that on our roadmap.




Thanks, Kevin.

Do you have any tips or tricks to apply role based permissions to entities? I know I can edit the DDL generated from the model, but would rather have it set up in the model.




Hi Nick,

You can use the After Script property to grant the roles on each entity. You could use the TDM scripting language to do that.

Here is a post that talks about how to use the scripting utility.

Here is some code that would generate the After Script for each entity in your model:

function main()


var e, iterEntity;

for (e=0; e<Model.Entities.Count; e++)


iterEntity = Model.Entities.GetObject(e);

iterEntity.AfterScript = “GRANT SELECT ON “+iterEntity.Name+” TO MYROLE”;




Hi Kevin,

Thank you for your help. I’ll have a look at the After script options and see how I go.