private void btnDialogOk_Click(object sender, RoutedEventArgs e)
        {
            //set values for config
            RoleRet   = RoleNameAnswer.Text;
            AccessRet = (AccessPermissionEnum)ComboBoxAccess.SelectedItem;

            this.DialogResult = true;
        }
 public InputModifyRole(string RoleName, AccessPermissionEnum access)
 {
     InitializeComponent();
     //set values to values that are currently set
     ComboBoxAccess.ItemsSource  = Enum.GetValues(typeof(AdskConstructionCloudBreakdown.AccessPermissionEnum));
     RoleNameAnswer.Text         = RoleName;
     ComboBoxAccess.SelectedItem = access;
     //in case that user canceled the input
     RoleRet   = RoleNameAnswer.Text;
     AccessRet = (AccessPermissionEnum)ComboBoxAccess.SelectedItem;
 }
 public InputModifyUser(string username, AccessPermissionEnum access, string company = "")
 {
     InitializeComponent();
     //set values to values that are currently set
     ComboBoxAccess.ItemsSource  = Enum.GetValues(typeof(AdskConstructionCloudBreakdown.AccessPermissionEnum));
     UserNameAnswer.Text         = username;
     CompanyAnswer.Text          = company;
     ComboBoxAccess.SelectedItem = access;
     //in case that user canceled the input
     UserRet    = UserNameAnswer.Text;
     CompanyRet = CompanyAnswer.Text;
     AccessRet  = (AccessPermissionEnum)ComboBoxAccess.SelectedItem;
 }
        public static String SelectPermission(AccessPermissionEnum input)
        {
            //Dictionary to link AccessPermission to String
            Dictionary <AccessPermissionEnum, string> permissionDict =
                new Dictionary <AccessPermissionEnum, string>();

            permissionDict.Add(AccessPermissionEnum.Viewonly, "V");
            permissionDict.Add(AccessPermissionEnum.ViewandDownload, "V+D");
            permissionDict.Add(AccessPermissionEnum.Publishonly, "U");
            permissionDict.Add(AccessPermissionEnum.ViewDownloadPublish, "V+D+U");
            permissionDict.Add(AccessPermissionEnum.ViewDownloadPublishEdit, "V+D+U+E");
            permissionDict.Add(AccessPermissionEnum.Full, "Full");

            return(permissionDict[input]);
        }
Exemplo n.º 5
0
        public UserPermission(User user, AccessPermissionEnum accessPermission)

        {
            AssignedUsers    = user;
            AccessPermission = accessPermission;
        }
Exemplo n.º 6
0
 public UserPermission(string mailAddress, AccessPermissionEnum accessPermission)
 {
     AssignedUsers    = new User(mailAddress);
     AccessPermission = accessPermission;
 }
Exemplo n.º 7
0
 public RolePermission(string role, AccessPermissionEnum accessPermission)
 {
     this.Role             = role;
     this.AccessPermission = accessPermission;
 }
 public void AddUser(User user, AccessPermissionEnum accessPerm)
 {
     UserPermissions.Add(new UserPermission(user, accessPerm));
 }
 /// <summary>
 /// Adds a user to the current folder
 /// </summary>
 /// <param name="mailAddress"></param>
 /// <param name="accessPerm">User permission </param>
 public void AddUser(string mailAddress, AccessPermissionEnum accessPerm)
 {
     UserPermissions.Add((new UserPermission(mailAddress, accessPerm)));
 }
 /// <summary>
 /// Adds a role permission to the current folder
 /// </summary>
 /// <param name="role"></param>
 /// <param name="accessPerm"></param>
 public void AddRolePermission(string role, AccessPermissionEnum accessPerm)
 {
     RolePermissions.Add(new RolePermission(role, accessPerm));
 }