Userprofiles - Verwaltung geändert
- Userprofile über eine eigen Klasse steuern - Klasse Userprofiles dazu - Enum Userprofiles entfernt - Einträge angepasst
This commit is contained in:
parent
7e74257c35
commit
351474022c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,17 +9,10 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using NX_Portal;
|
||||
|
||||
namespace Test_SichtbarkeitSteuern
|
||||
{
|
||||
// Die möglichen Usermodi
|
||||
enum Mode
|
||||
{
|
||||
Admin,
|
||||
Keyuser,
|
||||
User
|
||||
}
|
||||
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
#region Version und Copyright
|
||||
@ -129,28 +122,29 @@ namespace Test_SichtbarkeitSteuern
|
||||
|
||||
private void buttonAdmin_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetVisability(Mode.Admin);
|
||||
//SetVisability(Mode.Admin);
|
||||
SetVisability(Userprofiles.Profile.Administrator);
|
||||
|
||||
labelStatus.Text = "Status: Ein Administrator darf alles sehen und alles tun";
|
||||
}
|
||||
|
||||
private void buttonKeyuser_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetVisability(Mode.Keyuser);
|
||||
SetVisability(Userprofiles.Profile.KeyUser);
|
||||
|
||||
labelStatus.Text = "Status: Ein Keyuser darf alles sehen und manches tun";
|
||||
}
|
||||
|
||||
private void buttonUser_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetVisability(Mode.User);
|
||||
SetVisability(Userprofiles.Profile.User);
|
||||
|
||||
labelStatus.Text = "Status: Ein User darf manches sehen und nichts tun";
|
||||
}
|
||||
|
||||
private void SetVisability(Mode mode)
|
||||
private void SetVisability(Userprofiles.Profile profile)
|
||||
{
|
||||
VisibilityControl.SetVisability(mode);
|
||||
VisibilityControl.SetVisability(profile);
|
||||
|
||||
buttonDoSomething.Visible = VisibilityControl.ButtonDoSomethingVisible;
|
||||
buttonDoSomething.Enabled = VisibilityControl.ButtonDoSomethingEnabled;
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Userprofiles.cs" />
|
||||
<Compile Include="VisibilityControl.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
|
||||
32
Test_SichtbarkeitSteuern/Userprofiles.cs
Normal file
32
Test_SichtbarkeitSteuern/Userprofiles.cs
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Erstellt mit SharpDevelop.
|
||||
* Benutzer: hoeglinger_e
|
||||
* Datum: 14.06.2016
|
||||
* Zeit: 15:30
|
||||
*
|
||||
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
|
||||
*/
|
||||
using System;
|
||||
|
||||
namespace NX_Portal
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of Userprofile.
|
||||
/// </summary>
|
||||
public class Userprofiles
|
||||
{
|
||||
public enum Profile
|
||||
{
|
||||
SuperUser = 0,
|
||||
Administrator,
|
||||
Developer,
|
||||
KeyUser,
|
||||
AdvancedUser,
|
||||
User,
|
||||
Guest
|
||||
}
|
||||
|
||||
//Aufruf:
|
||||
//Beispiel: int i = (int)Userprofile.Profile.Administrator;
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NX_Portal;
|
||||
|
||||
namespace Test_SichtbarkeitSteuern
|
||||
{
|
||||
@ -31,17 +32,17 @@ namespace Test_SichtbarkeitSteuern
|
||||
public static bool ButtonUserEnabled { private set; get; }
|
||||
#endregion
|
||||
|
||||
public static void SetVisability(Mode mode)
|
||||
public static void SetVisability(Userprofiles.Profile profile)
|
||||
{
|
||||
switch (mode)
|
||||
switch (profile)
|
||||
{
|
||||
case Mode.Admin:
|
||||
case Userprofiles.Profile.Administrator:
|
||||
SetVisToAdmin();
|
||||
break;
|
||||
case Mode.Keyuser:
|
||||
case Userprofiles.Profile.KeyUser:
|
||||
SetVisToKeyuser();
|
||||
break;
|
||||
case Mode.User:
|
||||
case Userprofiles.Profile.User:
|
||||
SetVisToUser();
|
||||
break;
|
||||
default:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
4b25421e892f324b2f596035a6fa3b488e418361
|
||||
044b19d67f441b226b6ab048d8e770f031dccd7e
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user