As a variant to a recent post I did, here's another method to assign roles to a user, different is that this method will allow you to assign multiple number of roles in a single transaction.
Sometimes we need to manage roles programmatically with plugins to fulfill our customer requirements. This is great to allow Users to see data and append privileges. Find below a method that will assign a role to a user(Both sent as parameters).
Find below a C# method to check if an specified user(Sent as parameter) has System Admin role. The method will return true if so. Otherwise, it will return false. Hope it helps.
Sharing records its a great way to allow users to see data. Several ways exist to fulfill this requirement, some of them are the access teams and share buttons. However, there's another very useful way to share records, which is sharing records programmatically in a plugin. To do this, you can use the following method: … Continue reading Share record with User or Team