Replies: 4 comments
-
Not related. You could probably specify your Jetstream Team model in config/permissions.php. But you'll need to decide whether/when to use the roles/permissions provided by Jetstream vs those provided by this package. |
Beta Was this translation helpful? Give feedback.
-
The way you wrote this question supposes that your UI would be displaying permission-specific things for many teams on one page ... which often is the first way we think of something when brainstorming, but in practice most of the time our UI or even the current state of any call to the application is actually about the current User, and which Team they're on ... and then everything we're displaying doesn't need a bespoke check about the team_id. Thus, this package relies on the globally set team_id at any given moment. So, when you're displaying something about a particular team, you select that team and tell this package which team_id to scope all its querying to, and then check permissions (without passing a specific team_id, because it's added by the global value for the active team). A similar process is used when assigning team roles/permissions to a user: set the global team_id first, then grant the roles/permissions. |
Beta Was this translation helpful? Give feedback.
-
Is there anything stopping your Project from being your Team? In some applications it makes sense to treat them as the same thing: the people you assign to the project are its "team", and the team is created and disbanded for that project. But of course in other situations they aren't the same (ie: a "team" might be a department of people, and you're not assigning the whole department to a specific project). |
Beta Was this translation helpful? Give feedback.
-
@drbyte thank you for your comments. So, basically, it is almost as I thought. Based on your replys:
I.e. I guess something like that:
On the other hand, for easier member management I guess 2 additional tables: one for the team_id and the team owner and another holding the team_id and the member ID will be a good choice, correct? For example, the Project Owner role will be a global role. Thus, a user with this role will have many projects with many team members. To make it easier to move members between projects or adjust their permissions those 2 tables will come in handy. However, here comes another issue: The Team Leader role. A user can be a Team Leader on many projects, be just a member, and even be a Project Owner at some. |
Beta Was this translation helpful? Give feedback.
-
Scenario:
I have set 3 different roles (Project Owner, Team Leader and Team Member) and the appropriate permissions for each role (50 permissions in total)
On the other hand, I have the following models:
My goal is to have Team Leaders and Team Members on a "Project" basis i.e. on one project user can be a project owner, but on another one can be a team leader or team member thus it will possess different permissions.
That is why I think using the teams option will be the better approach i.e. when creating a project also create a team OR assign the team_id to be the same as the Project ID.
Still, how this can be implemented on a Project ID basis?
As far as I understand, I do not have to create a team i.e. have separate tables for team and team members.
All I have to do is give permission to a user and pass the team_id with it. But then, how can I check if a user has permission?
In Blade, we can use @can('permisson_name') ... @endcan but how to add the team_id to the equation?
Also I'd like to ask is that "team" feature related to the Jetstream teams or is a stand-alone?
Beta Was this translation helpful? Give feedback.
All reactions