WebVella / WebVella-ERP

Free and open-source pluggable ERP and CRM software based on ASP.NET Core 8, RazorPages and PostgreSQL . Targets Linux or Windows as host OS.
https://webvella.com/documents/developer/introduction/overview
Other
1.24k stars 464 forks source link

How to add permissions to buttons?按钮怎么添加权限? #196

Open victorpan888 opened 1 year ago

victorpan888 commented 1 year ago

I have a requirement to add role permission control to buttons. How can I achieve this? 我有这样一个需求,我想给按钮也添加角色的权限控制,该怎么实现?

bzashev commented 1 year ago

Hey, this is something that we often do. My practice is to use the Render property and write small code snippet and use it for the logic when the button to be rendered or not. It is often used on the whole form too if there is any

victorpan888 commented 1 year ago

Hi @bzashev ,Thank you for your answer,I just started learning this framework,Can you provide a demo? Thanks very much

bzashev commented 1 year ago

No demos regrettably. In the solution itself there is kind of a demo, a very outdated Project app, that has some base concepts in it. More info you can find in webvella.com

victorpan888 commented 1 year ago

hi @bzashev Can we provide an online demonstration address in the future for beginners to learn? Alternatively, add a more comprehensive example in the source code that includes as many aspects as possible. For example, as a framework developer, the button permissions I asked can be solved in just a few lines of code, but for beginners, this is too difficult

bzashev commented 1 year ago

It is a good idea but it is a matter of free time to do it. I will discuss this with the team and let you know.

victorpan888 commented 1 year ago

Okay, thank you very much. I'm going to use webvella for the project now, and I hope everything goes smoothly!

bzashev commented 1 year ago

We created it before about 10 - 15 years and are continuously using it and updating it. If that helps. It is very handy as a platform to quickly start and build an app.