Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KAFE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LeGTVaR
KAFE
Commits
193b2cc0
There was an error fetching the commit references. Please try again later.
Commit
193b2cc0
authored
1 year ago
by
Adam Štěpánek
Browse files
Options
Downloads
Patches
Plain Diff
Rename ProjectFilter.AccountId to AccessingAccountId
parent
1675e654
No related branches found
No related tags found
1 merge request
!23
Replace Capabilities with Permissions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Api/Endpoints/Project/ProjectListEndpoint.cs
+1
-1
1 addition, 1 deletion
Api/Endpoints/Project/ProjectListEndpoint.cs
Data/Services/ProjectService.cs
+3
-3
3 additions, 3 deletions
Data/Services/ProjectService.cs
with
4 additions
and
4 deletions
Api/Endpoints/Project/ProjectListEndpoint.cs
+
1
−
1
View file @
193b2cc0
...
...
@@ -39,7 +39,7 @@ public class ProjectListEndpoint : EndpointBaseAsync
public
override
async
Task
<
ActionResult
<
ImmutableArray
<
ProjectListDto
>>>
HandleAsync
(
CancellationToken
cancellationToken
=
default
)
{
var
projects
=
await
projectService
.
List
(
new
(
AccountId
:
userProvider
.
Account
?.
Id
),
cancellationToken
);
var
projects
=
await
projectService
.
List
(
new
(
Accessing
AccountId
:
userProvider
.
Account
?.
Id
),
cancellationToken
);
return
Ok
(
projects
.
Select
(
TransferMaps
.
ToProjectListDto
).
ToImmutableArray
());
}
}
This diff is collapsed.
Click to expand it.
Data/Services/ProjectService.cs
+
3
−
3
View file @
193b2cc0
...
...
@@ -164,7 +164,7 @@ public partial class ProjectService
public
record
ProjectFilter
(
Hrib
?
ProjectGroupId
=
null
,
Hrib
?
AccountId
=
null
Hrib
?
Accessing
AccountId
=
null
);
public
async
Task
<
ImmutableArray
<
ProjectInfo
>>
List
(
ProjectFilter
?
filter
=
null
,
CancellationToken
token
=
default
)
...
...
@@ -173,12 +173,12 @@ public partial class ProjectService
var
query
=
db
.
Query
<
ProjectInfo
>();
if
(
filter
.
AccountId
is
not
null
)
if
(
filter
.
Accessing
AccountId
is
not
null
)
{
query
=
(
IMartenQueryable
<
ProjectInfo
>)
query
.
Where
(
e
=>
e
.
MatchesSql
(
$"(
{
SqlFunctions
.
GetProjectPerms
}
(data ->> 'Id', ?) & ?) != 0"
,
filter
.
AccountId
.
Value
,
filter
.
Accessing
AccountId
.
Value
,
(
int
)
Permission
.
Read
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment