Skip to content

Commit

Permalink
"Create Security Privilege" util added
Browse files Browse the repository at this point in the history
  • Loading branch information
TrudAX committed Nov 28, 2018
1 parent a62c8ef commit 3669770
Show file tree
Hide file tree
Showing 9 changed files with 629 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A set of Visual Studio Add-ins for Microsoft Dynamics 365 for Operation that wil
* [Form builder](#form-builder)
* [Create find method](#create-find-method)
* [Create menu item](#create-menu-item)
* [Create security privilege](#create-security-privilege)
* [Troubleshooting](#troubleshooting)
* [Installation](#installation)

Expand Down Expand Up @@ -118,6 +119,11 @@ This Add-in works for Forms, Reports and Classes and creates Menu item for the s

![](assets/MenuItemBuilder.png)

## Create security privilege

This Add-in works for the selected Menu Item and creates new security privilege for this Menu Item. Label and Name are automatically updated when you change Access Level

![](assets/SecurityPrivilegeBuilder.png)

## Troubleshooting

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="SecurityPrivilegeBuilderParms" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>TRUDUtilsD365.SecurityPrivilegeBuilder.SecurityPrivilegeBuilderParms, TRUDUtilsD365, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Windows.Forms;

namespace TRUDUtilsD365.SecurityPrivilegeBuilder
{
public partial class SecurityPrivilegeBuilderDialog : Form
{
private SecurityPrivilegeBuilderParms _parms;

public SecurityPrivilegeBuilderDialog()
{
InitializeComponent();
}
public void SetParameters(SecurityPrivilegeBuilderParms parms)
{
AccessLevelComboBox.DataSource = Enum.GetValues(parms.AccessLevel.GetType());
MenuItemTypeComboBox.DataSource = Enum.GetValues(parms.MenuItemType.GetType());

_parms = parms;

securityPrivilegeBuilderParmsBindingSource.Add(parms);

securityPrivilegeBuilderParmsBindingSource.ResetBindings(false);
}

private void button1_Click(object sender, EventArgs e)
{
try
{
_parms.Run();

_parms.DisplayLog();

DialogResult = DialogResult.OK;
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, @"An exception occurred:", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void AccessLevelComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (_parms != null )
{
_parms.GenerateNames();
securityPrivilegeBuilderParmsBindingSource.ResetBindings(false);
}
}
}
}
Loading

0 comments on commit 3669770

Please sign in to comment.