Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

feat(team/permission):add sdk method for team and permission #62

Merged
merged 3 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ public interface IAuthClient
ISubjectService SubjectService { get; }

ITeamService TeamService { get; }

IPermissionService PermissionService { get; }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.BuildingBlocks.BasicAbility.Auth;

public interface IEnvironmentProvider
{
string GetEnvironment();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.BuildingBlocks.BasicAbility.Auth.Model;

public class MenuModel
{
public Guid Id { get; set; }

public string Name { get; set; }

public string Code { get; set; }

public string Icon { get; set; }

public string Url { get; set; }

public List<MenuModel> Children { get; set; } = new();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.BuildingBlocks.BasicAbility.Auth.Model;

public class TeamModel
{
public Guid Id { get; set; }

public string Name { get; set; }

public string Avatar { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.

namespace Masa.BuildingBlocks.BasicAbility.Auth.Service;

public interface IPermissionService
{
Task<List<MenuModel>> GetMenusAsync(string appId, Guid userId);

Task<List<string>> GetElementPermissionsAsync(string appId, Guid userId);

Task<bool> AuthorizedAsync(string appId, string code, Guid userId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ namespace Masa.BuildingBlocks.BasicAbility.Auth.Service;
public interface ITeamService
{
Task<TeamDetailModel?> GetDetailAsync(Guid id);

Task<List<TeamModel>> GetListAsync(Guid userId = default);
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ public interface IUserService
Task<List<StaffModel>> GetListByDepartmentAsync(Guid departmentId);

Task<UserModel?> AddAsync(AddUserModel user);

Task<bool> ValidateCredentialsByAccountAsync(string account, string password);

Task<UserModel> FindByAccountAsync(string account);
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
Expand Down