Hi All,
I am trying to create new custom sprights. however, i am not able to import the below code. Could you please help me with this.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE SPRight PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<SPRight name="ViewOwnCertifications" displayName="View Own Certifications">
<Description>Allows users to view only the certifications they initiated</Description>
<Script>
import sailpoint.object.Certification;
import sailpoint.api.SailPointContext;
import sailpoint.object.Identity;
import java.util.List;
SailPointContext context = SailPointFactory.getCurrentContext();
Identity currentUser = context.getUser();
List<Certification> certifications = context.getObjects(Certification.class);
for (Certification cert : certifications) {
if (cert.getInitiator().equals(currentUser)) {
// Add certification to the viewable list
viewableCertifications.add(cert);
}
}
return viewableCertifications;
</Script>
</SPRight>