Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
EShop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
EShop
Commits
1898c1ac
Commit
1898c1ac
authored
Apr 29, 2020
by
gdlcf88
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get/GetList permission requirement adjustment, close #13
parent
2f709752
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
CategoryAppService.cs
...n/EasyAbp/EShop/Products/Categories/CategoryAppService.cs
+14
-2
ProductDetailAppService.cs
.../EShop/Products/ProductDetails/ProductDetailAppService.cs
+1
-1
ProductAppService.cs
...tion/EasyAbp/EShop/Products/Products/ProductAppService.cs
+15
-3
No files found.
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs
View file @
1898c1ac
using
System
;
using
System
;
using
System.Linq
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
EasyAbp.EShop.Products.Authorization
;
using
EasyAbp.EShop.Products.Authorization
;
using
EasyAbp.EShop.Products.Categories.Dtos
;
using
EasyAbp.EShop.Products.Categories.Dtos
;
using
Microsoft.AspNetCore.Authorization
;
using
Volo.Abp.Application.Dtos
;
using
Volo.Abp.Application.Dtos
;
using
Volo.Abp.Application.Services
;
using
Volo.Abp.Application.Services
;
...
@@ -13,8 +15,8 @@ namespace EasyAbp.EShop.Products.Categories
...
@@ -13,8 +15,8 @@ namespace EasyAbp.EShop.Products.Categories
protected
override
string
CreatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Create
;
protected
override
string
CreatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Create
;
protected
override
string
DeletePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Delete
;
protected
override
string
DeletePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Delete
;
protected
override
string
UpdatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Update
;
protected
override
string
UpdatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Update
;
protected
override
string
GetPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Default
;
protected
override
string
GetPolicyName
{
get
;
set
;
}
=
null
;
protected
override
string
GetListPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Categories
.
Default
;
protected
override
string
GetListPolicyName
{
get
;
set
;
}
=
null
;
private
readonly
ICategoryRepository
_repository
;
private
readonly
ICategoryRepository
_repository
;
...
@@ -29,5 +31,15 @@ namespace EasyAbp.EShop.Products.Categories
...
@@ -29,5 +31,15 @@ namespace EasyAbp.EShop.Products.Categories
return
input
.
ShowHidden
?
query
:
query
.
Where
(
x
=>
!
x
.
IsHidden
);
return
input
.
ShowHidden
?
query
:
query
.
Where
(
x
=>
!
x
.
IsHidden
);
}
}
public
override
Task
<
PagedResultDto
<
CategoryDto
>>
GetListAsync
(
GetCategoryListDto
input
)
{
if
(
input
.
ShowHidden
)
{
AuthorizationService
.
CheckAsync
(
ProductsPermissions
.
Products
.
Default
);
}
return
base
.
GetListAsync
(
input
);
}
}
}
}
}
\ No newline at end of file
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductDetails/ProductDetailAppService.cs
View file @
1898c1ac
...
@@ -16,7 +16,7 @@ namespace EasyAbp.EShop.Products.ProductDetails
...
@@ -16,7 +16,7 @@ namespace EasyAbp.EShop.Products.ProductDetails
protected
override
string
CreatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Create
;
protected
override
string
CreatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Create
;
protected
override
string
DeletePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Delete
;
protected
override
string
DeletePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Delete
;
protected
override
string
UpdatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Update
;
protected
override
string
UpdatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Update
;
protected
override
string
GetPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Default
;
protected
override
string
GetPolicyName
{
get
;
set
;
}
=
null
;
protected
override
string
GetListPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Default
;
protected
override
string
GetListPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Default
;
private
readonly
IProductRepository
_productRepository
;
private
readonly
IProductRepository
_productRepository
;
...
...
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs
View file @
1898c1ac
...
@@ -7,7 +7,9 @@ using EasyAbp.EShop.Products.ProductCategories;
...
@@ -7,7 +7,9 @@ using EasyAbp.EShop.Products.ProductCategories;
using
EasyAbp.EShop.Products.ProductDetails
;
using
EasyAbp.EShop.Products.ProductDetails
;
using
EasyAbp.EShop.Products.Products.Dtos
;
using
EasyAbp.EShop.Products.Products.Dtos
;
using
EasyAbp.EShop.Products.ProductStores
;
using
EasyAbp.EShop.Products.ProductStores
;
using
Microsoft.AspNetCore.Authorization
;
using
Volo.Abp
;
using
Volo.Abp
;
using
Volo.Abp.Application.Dtos
;
using
Volo.Abp.Application.Services
;
using
Volo.Abp.Application.Services
;
using
Volo.Abp.Domain.Entities
;
using
Volo.Abp.Domain.Entities
;
...
@@ -19,8 +21,8 @@ namespace EasyAbp.EShop.Products.Products
...
@@ -19,8 +21,8 @@ namespace EasyAbp.EShop.Products.Products
protected
override
string
CreatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Create
;
protected
override
string
CreatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Create
;
protected
override
string
DeletePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Delete
;
protected
override
string
DeletePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Delete
;
protected
override
string
UpdatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Update
;
protected
override
string
UpdatePolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Update
;
protected
override
string
GetPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Default
;
protected
override
string
GetPolicyName
{
get
;
set
;
}
=
null
;
protected
override
string
GetListPolicyName
{
get
;
set
;
}
=
ProductsPermissions
.
Products
.
Default
;
protected
override
string
GetListPolicyName
{
get
;
set
;
}
=
null
;
private
readonly
ISerializedAttributeOptionIdsFormatter
_serializedAttributeOptionIdsFormatter
;
private
readonly
ISerializedAttributeOptionIdsFormatter
_serializedAttributeOptionIdsFormatter
;
private
readonly
IProductStoreRepository
_productStoreRepository
;
private
readonly
IProductStoreRepository
_productStoreRepository
;
...
@@ -176,6 +178,16 @@ namespace EasyAbp.EShop.Products.Products
...
@@ -176,6 +178,16 @@ namespace EasyAbp.EShop.Products.Products
return
dto
;
return
dto
;
}
}
public
override
Task
<
PagedResultDto
<
ProductDto
>>
GetListAsync
(
GetProductListDto
input
)
{
if
(
input
.
ShowHidden
)
{
AuthorizationService
.
CheckAsync
(
ProductsPermissions
.
Products
.
Default
);
}
return
base
.
GetListAsync
(
input
);
}
public
async
Task
DeleteAsync
(
Guid
id
,
Guid
storeId
)
public
async
Task
DeleteAsync
(
Guid
id
,
Guid
storeId
)
{
{
await
CheckDeletePolicyAsync
();
await
CheckDeletePolicyAsync
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment