---
title: "Create a validator for a component lead"
canonical: "https://support.appfire.com/space/PSJ/15480648/Create%20a%20validator%20for%20a%20component%20lead"
format: markdown
---
> Macro (aura-html)


```
string [] comp = component;
boolean pass = false;

string errorMsg = "You can only have a single component assigned to this issue";

if(arraySize(comp) > 1) {
    return false, "error", errorMsg;
}

errorMsg = "Only the component lead can perform this action";

for(string c in comp) {
    if(getProjectComponentLead(project, c) == currentUser()) {
        pass = true;
    }
}

if(!pass) {
    return false, "error", errorMsg;
}
```