There is a WinForms application.

To access certain elements of the interface must be appropriate rights.

When I first open the application, I read them from the WCF service and, on the basis of this, I transfer the elements to a state inaccessible.

And what should I do if during a session a user changes rights?

What was previously available is now unavailable or vice versa.

I had an idea to hang a timer event on the main form and N-minutes to check the rights.

Permissions are stored in SQL Server, and WCF reads them by login.

How correct is this implementation and is there a better way?

  • In general, they usually do this: rights are read once at the start of the application. If after that the admin has changed something, and I want to get new functionality, the application simply restarts. - andreycha
  • You can check permissions every time you use an interface element. For example, when you click on the button, the rights check first. Then do not need a timer. - Alexander Petrov
  • @AlexanderPetrov then it is easier on the service side to rip out logins from the context of operations and check. If not, then throw exceptions - iluxa1810

0