🐛 Trying to fix permission that inherits from groups.
This commit is contained in:
parent
9e7ba820c4
commit
185ab13ec9
@ -19,7 +19,7 @@ public class RealtimeCallController(IConfiguration configuration, AppDatabase db
|
|||||||
|
|
||||||
[HttpGet("{roomId:guid}/join")]
|
[HttpGet("{roomId:guid}/join")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<IActionResult> JoinCall(Guid roomId)
|
public async Task<ActionResult<JoinCallResponse>> JoinCall(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
|
@ -48,14 +48,14 @@ public class PermissionService(
|
|||||||
if (groupsId == null)
|
if (groupsId == null)
|
||||||
{
|
{
|
||||||
groupsId = await db.PermissionGroupMembers
|
groupsId = await db.PermissionGroupMembers
|
||||||
.Where(n => n.Actor == actor)
|
.Where(n => n.Actor == "user:" + actor)
|
||||||
.Where(n => n.ExpiredAt == null || n.ExpiredAt < now)
|
.Where(n => n.ExpiredAt == null || n.ExpiredAt < now)
|
||||||
.Where(n => n.AffectedAt == null || n.AffectedAt >= now)
|
.Where(n => n.AffectedAt == null || n.AffectedAt >= now)
|
||||||
.Select(e => e.GroupId)
|
.Select(e => e.GroupId)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
await cache.SetWithGroupsAsync(groupsKey, groupsId,
|
await cache.SetWithGroupsAsync(groupsKey, groupsId,
|
||||||
new[] { _GetPermissionGroupKey(actor) },
|
[_GetPermissionGroupKey(actor)],
|
||||||
CacheExpiration);
|
CacheExpiration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,9 +75,9 @@
|
|||||||
"SubjectPrefix": "Solar Network"
|
"SubjectPrefix": "Solar Network"
|
||||||
},
|
},
|
||||||
"RealtimeChat": {
|
"RealtimeChat": {
|
||||||
"Endpoint": "",
|
"Endpoint": "https://solar-network-im44o8gq.livekit.cloud",
|
||||||
"ApiKey": "",
|
"ApiKey": "APIs6TiL8wj3A4j",
|
||||||
"ApiSecret": ""
|
"ApiSecret": "SffxRneIwTnlHPtEf3zicmmv3LUEl7xXael4PvWZrEhE"
|
||||||
},
|
},
|
||||||
"GeoIp": {
|
"GeoIp": {
|
||||||
"DatabasePath": "./Keys/GeoLite2-City.mmdb"
|
"DatabasePath": "./Keys/GeoLite2-City.mmdb"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user