Creating new spright to view the certifications created by the owner / workgroups

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>

Hi @arunpandiyan_s

For sure you should replace < character in code with @lt.
Although in general, I’ve never seen SPRight with source code. Could you explain what use case you want to implement with this? Maybe we can sugges some solution then.