You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.3 KiB
49 lines
1.3 KiB
using Model;
|
|
|
|
namespace Services;
|
|
|
|
public interface ITeamService
|
|
{
|
|
public Task<IEnumerable<Team>> ListTeamsOf(int userId);
|
|
|
|
|
|
public Task<IEnumerable<Team>> ListTeams(int start, int count);
|
|
public Task<int> CountTotalTeams();
|
|
|
|
public Task<Team> AddTeam(string name, string picture, string firstColor, string secondColor);
|
|
public Task RemoveTeams(params int[] teams);
|
|
|
|
public Task<IEnumerable<Member>> GetMembersOf(int teamId);
|
|
|
|
public Task<Member?> AddMember(int teamId, int userId, MemberRole role);
|
|
|
|
public Task<bool> UpdateMember(Member member);
|
|
|
|
public Task<bool> RemoveMember(int teamId, int userId);
|
|
|
|
public Task<bool> UpdateTeam(Team team);
|
|
|
|
enum TeamAccessibility
|
|
{
|
|
/**
|
|
* The Team or the user is not found
|
|
*/
|
|
NotFound,
|
|
/**
|
|
* Accessibility not granted
|
|
*/
|
|
Unauthorized,
|
|
/**
|
|
* Accessibility granted
|
|
*/
|
|
Authorized
|
|
}
|
|
|
|
/**
|
|
* Ensures that the given user identifier van perform an operation that requires the given role permission.
|
|
* The returned result is the different kind of accessibility the service can grant to the user, based on its actual role inside the
|
|
* given team.
|
|
*/
|
|
public Task<TeamAccessibility> EnsureAccessibility(int userId, int teamId, MemberRole role);
|
|
|
|
} |