java - Spring Security - Why have separate classes for user and role? -
i trying implement spring security app, , because of have been reading lot of articles on net. 1 thing have noticed there lot of examples user role class separated user class. why so, general best practice rule? or there possibility add role field user class , use enum data type, instead of heaving 2 tables in database authentication, have one? can me understand this...
a user can have more 1 role. member of support team can have rules "user" , "support" can use system in same way normal user can verify problem reports, example.
another example want fine grained roles. instead of "admin" , "user", can have different user roles guests , people may work on part of system.
think ebay: have customers , sellers. sellers can more mere buyers. sellers need buy things if want. sellers may want split people "can add offers" , "can give discount." while employees have former, select few have latter.
Comments
Post a Comment