The following example code shows how to delete a granted role:
USING OpenEdge.DataAdmin.*. 
USING OpenEdge.DataAdmin.Lang.Collections.*. 

VAR DataAdminService oDAS. 
VAR IGrantedRoleSet oGrants. 
VAR IGrantedRole oGrant. 
VAR IIterator iter. 

oDAS = NEW DataAdminService(LDBNAME("DICTDB")). 
oGrants = oDAS:GetGrantedRoles("where RoleName eq 'TestRole'"). 

iter = oGrants:Iterator(). 
DO WHILE iter:HasNext():
	ASSIGN oGrant = CAST(iter:Next(), IGrantedRole).
	oDAS:DeleteGrantedRole(oGrant:id).
END.
Note: The following table lists the conditions that specify who has the authority to delete granted roles:
Condition Role deleted by…
Security administrator is defined for a connected database Security administrator
Security administrator is not defined for a connected database Grantor who originally granted the role
For more information on the conditions that specify who can grant roles, see Grant role to a user using OpenEdge.DataAdmin.*.