//Add the campaigns table to this new data source
Entity myNewEntity = api.Entities.NewEntity("CampaignsRole");
myNewEntity.DataSourceId = api.DataSources.GetDataSource("Donations").Id;
myNewEntity.ObjectType = DataObjectType.Table;
myNewEntity.Id = "campaigns_10";
myNewEntity.DbName = "Campaigns";
myNewEntity.Name = "campaigns";
myNewEntity.ObjectDescription = "Fundraising campaigns";
myNewEntity.Category = "CRM\\Sales";
//Create a role that restricts user to ONLY that Data Object
api.Roles.NewRole("Restricted User");
Role r = api.Roles.GetRole("Restricted User");
DataObject d = r.Security.DataObjects.NewDataObject();
d.Name = myNewEntity.Id;
r.Security.DataObjects.IncludeAll = false;