Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chords's avatar

Managing team roles

Hi all, has anyone successfully leveraged the team roles functionality? If so, here's where i'm struggling. The documentation reads:

Spark allows you to define roles for your team's members. By default, Spark has two roles: owner and member. However, you may define additional roles which the owner of a team can then assign to users from the team membership screen.

Honing into two specifics:

you may define additional roles

I added a Manage role, but Member isn't in the dropdown, leading me to believe this replaces the Owner and Member paradigm, but the documentation isn't clear. I assume Owner is always a role?

then assign to users from the team membership screen

It looks to me like there is functionality only to assign a user a role upon inviting them, but there is no functionality to change their role once they're on the team. Is this correct?

0 likes
9 replies
bobbybouwmann's avatar

Well the roles are stored in the database, so you should be able to edit then. However this is not default behaviour of Spark, so you would need to build this yourself.

Also the owner is always a role, but it just doesn't show.

The documentation of Spark is lacking a lot, but I also think this is because of the focus on the other products for now. I hope it gets a fresh update soon as well!

1 like
chords's avatar

Thanks, @bobbybouwmann. I've made some progress, and it looks like you can change a user's role. The two above questions were playing against each other, in my case.

There is a modal for editing a user's role, but the edit button will only display if there are at least two roles. What's confusing is that there must be at least two roles defined in the Spark::useRoles array, and that does not include Owner (which exists by default) or Member (which doesn't exist by default). In the view, there are references to roles.length > 1 on whether to show or hide the table column and edit button.

This actually makes sense but it's not the functionality I was looking for.

Here's why: the Spark team designed this so that whoever signs up is the owner, and the owner can't be changed, so there's no point in displaying this functionality when there are two roles inclusive of the Owner role.

The functionality I want is the Owner role and a Viewer role, where the Owner can create additional Owners (in case the wrong user signed up for the free trial, and doesn't have access to a credit card and other owner-level things my application requires).

So, the functionality is there, I still have some work to do though! We'll see what the implications wind up being of having multiple owners...

Cronix's avatar

The functionality I want is the Owner role and a Viewer role, where the Owner can create additional Owners

I think the problem there is the owner role is special. They are the ones who get billed for the team. Not sure how you'd do that if you assign multiple owners to the same team.

1 like
chords's avatar

That's my concern -- how tightly coupled is the specific user to the billing info? I haven't looked closely yet.

If it's just a permissions thing, I don't mind multiple users sharing the role to have access to the billing info, if they so choose. Or, alternatively, I'll have to build the functionality to transfer ownership (unless that also exists, but I haven't seen it).

Cronix's avatar

You're talking about 2 systems though.

Laravel, and Stripe. The user gets created in both basically, and billed/charged from that single account in Stripe. I don't know how you'd

multiple users sharing the role to have access to the billing info, if they so choose

It's pretty tightly coupled, and more than just a permission thing. You'd be rewriting a lot of php logic and vue code. In the team setting, everything goes through the owner role.

bobbybouwmann's avatar

@cronix is right. I think it's better to create another role that works like owner but that is another role. So each user that needs to act like a owner gets that new role. This way you can still do the same things ;)

chords's avatar

Really appreciate the continued conversation. I see what you're both saying with the Stripe integration, I really don't want to mess with any of that, so multiple owners is out!

If there can be only one owner, how do you all handle if that one user, for example, leaves the company and thus the team? Do you think building an owner transfer feature is plausible or would you deal with that scenario another way?

Cronix's avatar
Cronix
Best Answer
Level 67

You could do that. Ideally, the "owner" would just hand the account info over to the next person who would takeover the owner role. They could just login and just change all of the personal details, billing details, etc. You wouldn't have to do anything. That's now we use it anyway. We consider the team owner a company, and it's up to them who manages "their account." Most are using corporate credit cards and such.

1 like
chords's avatar

I come from a more corporate environment where sharing credentials, even internally, can be a fireable offense, so that approach feels wrong. But you're right, that's an entirely reasonable approach in most cases -- I get caught up in my own world too often. Even if I build out ownership transferring, that certainly doesn't have to be MVP!

Thanks, @cronix, for your time and insight!

Please or to participate in this conversation.