/// <summary>
        /// Returns Role Privileges from given Role.
        /// </summary>
        public List <ModelRolePrivilege> GetRolePrivileges(ModelRole role)
        {
            // All downloaded Entities
            var rolePrivileges = this.RetrieveMultiple(FetchQueriesHelper.GetPrivilegesForRole(role));
            var list           = new List <ModelRolePrivilege>();

            // Parse Entities
            foreach (var rolePrivilege in rolePrivileges.Entities)
            {
                var parsed = rolePrivilege.ToRolePrivilege();
                list.Add(parsed);
            }
            return(list);
        }
        /// <summary>
        /// Main method used for calculating permissions and displaying them in the Permissions box.
        /// </summary>
        private void CalculatePermissions()
        {
            this.wB_Permissions1.RemoveAll();

            // Don't count anything if user is not selected
            if (this.CurrentSelectedUser == null)
            {
                return;
            }

            // Returns all Roles for specified User by SystemUserId
            var userRoles = this.RetrieveMultiple(FetchQueriesHelper.GetRolesForUser(this.CurrentSelectedUser)).ToSystemModelWithRoles();

            CheckRolesForSelectedUser(userRoles);
            //var html = HtmlHelper.PrepareHtml(userRoles, this, this.EntitiesMetadata);

            ICollection <DataRow> rows = GetDataRowCollection(userRoles, this.EntitiesMetadata);

            this.wB_Permissions1.AddRange(rows);
        }