Summer Sale! All accounts are 50% off this week.

ppounder's avatar

Only allow Developers to create additional teams

Hi there,

Any thoughts on how we can prevent all users apart from developers from creating additional teams.

I have noAdditionalTeams() in my SparkServiceProvider, but I do want my Developers to be able to create teams and enrol users on there. Not sure how I can do this without either amending the UI (which is more than possible) so that users can't get to the create team page, or actually changing the Spark code, which I don't want to do.

Anyone done anything similar?

Regards

Paul

0 likes
1 reply
Cronix's avatar
Cronix
Best Answer
Level 67

Override noAdditionalTeams() to do a check to see if the user is a developer?

The method is just

public static function noAdditionalTeams()
    {
        static::$createsAdditionalTeams = false;

        return new static;
    }

So you should be able to do a check in there to set it to true/false.

Please or to participate in this conversation.