# منع المستخدمين من تغيير أسمائهم الكاملة

**URL:** <https://meta.discourse.org/t/prevent-users-from-changing-their-full-names/261337>\
**Category:** Feature\
**Created:** [11 أبريل 2023، 4:21م UTC](https://meta.discourse.org/t/prevent-users-from-changing-their-full-names/261337 "2023-04-11T16:21:06Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [12 أبريل 2023، 7:53م UTC](https://meta.discourse.org/t/prevent-users-from-changing-their-full-names/261337/12 "2023-04-12T19:53:07Z")

</div>

لقد ألقيت نظرة؛ يمكن إخفاء الحقل باستخدام واجهة برمجة التطبيقات، لكنني لا أستطيع العثور على أي بيانات يمكنني الاعتماد عليها لمعرفة ما إذا كان هذا المستخدم معتمدًا أم لا (في سياق صفحة التفضيلات) 🤔

هذا ما لدي في الوقت الحالي.  
لست متأكدًا مما إذا كان يجب أن أشعر بالسوء؛ ربما يكون الأمر مخترقًا قليلاً هنا. 😄

> **js**
>
> ```js
> 
> <script type="text/discourse-plugin" version="0.8">
> 
> const { setting } = require("discourse/lib/computed");
> 
> api.modifyClass("controller:preferences/account", {
> pluginId: "hide-name-in-preferences",
> 
> get canEditName() {
> const enables_name = setting("enable_names");
> 
> if (enables_name && this.isCurrentUser && !this.model.staff) {
> if (this.model.name) {
> // Hide only the input field (name is displayed)
> this.model.can_edit_name = false;
> } else {
> // Hide the whole section
> return false;
> }
> }
> 
> return enables_name;
> },
> });
>     
> </script>
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/prevent-users-from-changing-their-full-names/261337)._
