WebVella/WebVella-ERP

Add some functions

Closed this issue · 3 comments

Thank you very much for your efforts

I like this ERP system very much

Can I add several functions

  1. HOOK of search, for example, when user A searches the table, he can only search his own row

  2. Other HOOK can only be used to change your own line

  3. The module management function is implemented by using plug-ins (dynamic loading)

Thanks again

Hey, thanks for giving us a chance.
With hooks you can insert your code in various places and it can limit the functionality access or scope.
Can you explain your idea in a little more details, as I think it can be done now too.

  1. Hook search

Generally speaking, sometimes we need to specify that certain lines can only be seen by some users and not by others, such as the user's own order. My previous operation is to add SQL statements (uid={uid}) after the user uses the SELECT statement. In this way, even if the user uses the search statement: SELECT * FROM a, he will eventually search only his own lines

Later, it was found that someone implemented it in another way, that is, each line will have a system field:_ Groups. After generating SQL statements, users will be forced to add judgments on user groups to manage row permissions

My ultimate hope is that when users execute EQL, they can use the code hook, and then we can add our own search criteria, so that it is more flexible

  1. Module thermal loading

2.1 All modules generate Nuget packages and place them in the plugs directory

2.2 Program addition table: module management table

2.3 Add and delete module functions (I can dynamically load modules, but I don't know how to dynamically unload them)

Dynamic loading module:

var path = @"D:\Documents\Downloads\WebVella-ERP-master\WebVella-ERP-master\WebVella.Erp.Site\bin\Debug\net7.0\Plugs";

var assemblyFiles = Directory.GetFiles(path, "WebVella.Erp.Plugins.*.dll", SearchOption.AllDirectories);

foreach (var assemblyFile in assemblyFiles)

{

try

{

var assembly = Assembly.LoadFrom(assemblyFile);

dynamic obj = assembly.CreateInstance("WebVella.Erp.Plugins.Mail.MailPlugin");

iapp = iapp.UseErpPlugin(obj as ErpPlugin);

}

catch (Exception) { }

}

Hello,

  1. We are not planning to implement multi-tennant support into ERP at this moment.
  2. We are working on this idea for next versions. At the moment it is not clear because we want to download nugets automatically with their depencency trees, but there are no answers for depencency conflicts yet. We are researing posibility to run plugins in different application domains, but then another problem occurs with hosting and ports.