AyushPayasi
AyushPayasi

Reputation: 237

no permission to see this field in strapi

I am unable to enter data to fields which I have created in user collection type in strapi.

I wanted to create extra fields in user collection in strapi so I created some extra fields from builder , but when trying to enter data , the newly created fields are not editable .

Upvotes: 9

Views: 9160

Answers (6)

Rodion
Rodion

Reputation: 521

Ohh... I found a problem in my case. When you create a new field for an entity you should setup access to this field for a particular role:

  • Go to Admin Roles page
  • Choose your role
  • Find needed content type
  • Expand a list of fields for this content type
  • Check if all access has been set correctly

Upvotes: 0

rweisse
rweisse

Reputation: 830

After none of the solutions describe here worked for me I found a "quick" way to fix this.

  1. Open the corresponding schema.json of your affected collection:
-src
  |-api
     |- <singularName of collection>
        |- content-types
           |- service
              |- schema.json
  1. Add temporally "required": true, to the field under attributes:
{
  "kind": "collectionType",
  "collectionName": "xxx",
  "info": {
    "singularName": "xxx",
    "pluralName": "xxxs",
    "displayName": "XXX",
    "description": ""
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {},
  "attributes": {
    /* [...] */
    "yourFieldName": {
      "type": "relation",
      "required": true, // <== ADD HERE!
      "relation": "manyToMany",
      "target": "api::yyy.yyy",
      "inversedBy": "zzz"
    },
    /* [...] */
  }
}
  1. If the field is a relation (manyToMany) open the corresponding collection and repeat the step above for this collection.
  2. Run strapi in development mode: npm run develop (depending on your command defined in package.json.)
  3. Stop the development mode.
  4. Revert back your changes in schema.json files.
  5. Run and stop strapi in development mode again.

This should fix the broken entry in the database. From now on the field should be visible.

Upvotes: 0

Denis
Denis

Reputation: 1

I got this issue after updating to the 3.6.11 version. Try to remove .cache and build folders and rebuild the app. This worked for me.

Upvotes: 0

sarabs3
sarabs3

Reputation: 594

This issue generally occurs when new fields are added to existing content types.

In my case, Simply signing out and logging in back in with your Admin account solves the issue. This will reset the permission issue for newly created fields.

Upvotes: 13

Gorgsenegger
Gorgsenegger

Reputation: 7856

After I ran into the issue multiple times myself and couldn't fix it even after re-deploying again (and again...), I found the following worked for me:

  • In the deployed version, go to Content-Type Builder
  • Select the content type that contains the field causing problems
  • Click the Configure the view button
  • Change the position of an arbitrary field
  • Click Save

This worked for me and also didn't require a re-deployment of my app.

Upvotes: 1

AyushPayasi
AyushPayasi

Reputation: 237

You can try following ways, and check if any one of them works -

Method 1

there can always be an issue with Strapi server,

  • I restarted the server manually and it is fixed.

Method 2

your user might not have permission to view that field. you can change permission of a user by -

step 1 - Login to your strapi cms with Admin account and check if you are able to edit that field(the one with no permission), if so then continue with following steps, else this method wont work for you.

setp 2 - click on settings in left panel , select the user , from the list select the user that you want to change permission with, give read write , and other permissions you want to give.

re-login with your account from which you were facing the problem, it should work now

Method 3

There might be a sync issue with your DB, sometimes your data is not synced with your DB, try deleting the field and re creating it.

I hope one of this solves your issue

Upvotes: 8

Related Questions