appifyhub / monolith

The backbone backend service of Appify Hub
https://appifyhub.com
MIT License
1 stars 0 forks source link

Access Manager 2.0 #174

Open milosmns opened 6 months ago

milosmns commented 6 months ago

Provide a brief summary of the planned work

Access Manager is used for authentication and authorization today, as well as feature management and dependency control. As a result of various migrations, the current implementation has become challenging to manage and understand.

We should refactor it to simplify and improve.

Detailed overview

Some improvement areas include:

val accessResult: AccessResult<User> = accessManager.requestAccess(
  targetType = Targets.USER,
  targetId = request.path.userId,
  targetPermission = Permissions.USER_WRITE_DATA,
  credentials = request.token,
)

if (accessResult.isForbidden) throwForbidden("Unauthorized")

val user = accessResult.content

Hint/location:

com.appifyhub.monolith.features.auth.domain.access.AccessManager

List the acceptance criteria

Include any additional notes (optional)

No response