public static RoleGrant loadCurrentUserDirectRoleGrant(OracleDataReader odr) { string username; string grantedRole; bool adminOption; bool defaultRole; bool directGrant; if (odr.IsDBNull(odr.GetOrdinal("username")) || odr.IsDBNull(odr.GetOrdinal("granted_role"))) { return(null); } username = odr.GetString(odr.GetOrdinal("username")); if (username.Equals("PUBLIC")) { directGrant = false; } else { directGrant = true; } grantedRole = odr.GetString(odr.GetOrdinal("granted_role")); adminOption = RoleGrant.ParseAdminOption(odr.GetValue(odr.GetOrdinal("admin_option"))); defaultRole = RoleGrant.ParseDefaultRole(odr.GetValue(odr.GetOrdinal("default_role"))); return(new RoleGrant(username, grantedRole, adminOption, defaultRole, directGrant)); }
public static RoleGrant loadDbaRoleGrant(OracleDataReader odr) { string grantee; string grantedRole; bool adminOption; bool defaultRole; if (odr.IsDBNull(odr.GetOrdinal("grantee")) || odr.IsDBNull(odr.GetOrdinal("granted_role"))) { return(null); } grantee = odr.GetString(odr.GetOrdinal("grantee")); grantedRole = odr.GetString(odr.GetOrdinal("grantedRole")); adminOption = RoleGrant.ParseAdminOption(odr.GetValue(odr.GetOrdinal("admin_option"))); defaultRole = RoleGrant.ParseDefaultRole(odr.GetValue(odr.GetOrdinal("default_role"))); return(new RoleGrant(grantee, grantedRole, adminOption, defaultRole, true)); }