tsk-76: Added model and context for AccessLevel (#108)

* tsk-76: Added model and context for AccessLevel

* Formatted code

* AccessLevel migrations are working

* minor formatting

* tsk-#76: Saving AccessLevel when uploading song

* tsk-#76: Added endpoints

* tsk-#76: Warning fix

* tsk-#76: Adding more controller code

* Functionality to modify access levels is operational

* Formatting

* tsk-#76: Added functionality

* tsk-#76: Formatting code

* tsk-#76: Adding more code

* tsk-#76: Formatting
This commit was merged in pull request #108.
This commit is contained in:
KD
2025-03-11 21:45:32 -04:00
committed by GitHub
parent 9d90247bf8
commit dcb51448aa
11 changed files with 355 additions and 25 deletions
+14
View File
@@ -86,6 +86,20 @@ public class SongController : BaseController
});
}
var tokenManager = new TokenManager(this._config!);
var accLvlContext = new AccessLevelContext(this._connectionString!);
var accessLevel = accLvlContext.GetAccessLevel(song.Id);
var token = tokenManager.GetBearerToken(HttpContext);
if (token == null || accessLevel == null)
{
return BadRequest();
}
if (!tokenManager.CanAccessSong(token, song, accessLevel))
{
return BadRequest();
}
var songRes = _songMgr.UpdateSong(song);
return Ok(songRes);