کلا صحبت من توی روش اول یا
RBAC هست الان؛ یکسری claimها رو میشه بصورت مشترک و جامع برای
کاربر داشت و برای همه کلاینتها یک معنی میده. مثل profile, address, ... یک کاربر مشترک هست. این درست. اما برای حالتی که چندین کلاینت داریم و هرکدوم
claimهای خاص خودشون رو نیاز دارن. یا بطور خاص
role های خودشون رو دارن. مثلا کاربری با نام علی در
کلاینت یک (سامانه حقوق و دستمزد)، نقشهای زیر رو داره که فقط برای
کلاینت یک معنی میده:
- ثبت کننده اطلاعات
- کاربر عادی
همین کاربر، در کلاینت دو (سامانه اتوماسیون اداری) نقشهای زیر رو داره که فقط برای کلاینت دو معنی میده:
- مدیر منطقه یک
- کاربر عادی
- تنظیم کننده گردش کار اداری
متوجه این قضیه هستم که میشه سمت identityServer برای هر کلاینت، claimهای مجاز خودش رو بهش دسترسی داد و منتسب کرد. ولی در شرایطی که مثلا 50 تا سامانه (کلاینت) مختلف، 100 نقش مختلف برای هندل کردن بیزینس خودشون دارن، آیا باید تمام این 100 نقش رو در سمت identityServer تعریف کنیم و به هر کلاینت، نقشهای مجاز خودش رو منتسب کنیم و هر زمان که یک سامانه، یک نقش جدید نیاز داشته باشه، باز بیایم و در IdentityServer اون رو تعریف کنیم؟ یعنی راه درست همینه؟
سوالم در نهایت اینه:
1. حالا به این شکل، آیا باید تمام این نقشها در سمت IdentityServer در claimها (role claim) تعریف بشه؟
2. هر کلاینت که چند وقت بعد، نیاز داره یک role جدید دیگه در بیزینس داخلی خودش داشته باشه، باید سمت IdentityServer بیاد و اضافه کنه اون role رو تحت عنوان یک role claim جدید؟ و سپس، همین role رو به کاربرایی که مد نظرش هست، اعطا کنه؟