I create a new strapi project. I’m running it with “yarn develop”.
I have configured NGINX to work with my subdomain.
I created 3 SINGLE TYPES content with Super User.
Then I created another user in “ADMINISTRATION PANEL → Users” and gave that user the role editor.
But this user cannot edit anything besides the Plugin Media Library.
What do I need to do for the user-created as Editor to be able to edit any content?
This doesn’t work in development mode and also single mode. Basically, the Editor role has absolutely zero permission by default and there is no way to give him permission as all those fields show as not available.
Every where I read it says the Editor has the capability to edit content of other author. I gave him the author role and same thing cannot create any content.
The solution to my problem was as simple as clicking on the content items and then the RBAC Editor role was automatically able to edit what was selected.
Yeah taking a second look with you I can understand the confusion, the UI here isn’t really clear as everything looks very grayed out and it’s hard to determine where to click to enable things.
Is it possible the limit the number of items an editor for example may create?
so in collection “dishes” he may add 30 items, and on collection “cooks”, just one?
thanks.
Not currently @aviavia, it might be possible with the conditionals that are in beta (no public documentation for them yet) but those options are only in our Enterprise editions
It should be yes using conditionals, the documentation for that isn’t released yet but I can provide the prototype here (this may be subject to change when we release I18N):
Using RBAC conditions
Warning
This API is considerred unstable for now
Adding a new condition
In your bootstrap file located in ./config/functions/bootstrap.js you can do the following:
const conditions = [
{
displayName: "Entity has same name as user",
name: "same-name-as-user",
plugin: "name of a plugin if created in a plugin"
handler: (user) => {
return { name: user.name };
},
},
];
module.exports = () => {
// do your boostrap
strapi.admin.services.permission.conditionProvider.registerMany(conditions);
};
Condition
A condition have 4 possible properties:
displayName: name showed in the UI
name: technical name. Should be kebab-cased
plugin: If you create a plugin condition add the plugin name. e.g content-manager
handler: A function (sync or async) that returns a condition object. Read more here
Handler
The condition handler receives the authenticated user making the request.
It should return oneOf:
true:
Returning true means the condition will always match.
It is usefull if you want to verify an external condition or a condition on the authenticated user only.
false:
Returning false means the condition will never match.
It is usefull if you want to verify an external condition or a condition on the authenticated user only.
Condition object:
A condition obect is an matcher object that will allow verify conditions on the entities you read, create, update or delete.
We use sift.js behind the scenes to do the condition matching. Here are the list of allowed operators:
So I will be able to create a condition that counts how many items current user created on that collection , and checks the user’s role, and according to the returned true or false, will display/ or not the “add more items” button?
And when will this feature be available?
Thanks
I believe so, though I’ve never need a conditional like that. The feature already exists, it’s just in a beta/prototype stage. We expect some changes when I18N is released but outside of that I don’t have a “stable” date for it yet.
Thanks,
could anyone return to me with an official reply and a code sample?
As I need to decide whether to pay for the yearly plan to achieve this feature or create a client that can handle this, which is redundant work and an asset to host, deploy, manage, etc".
You didn’t need it, but the use case is so basic, and probably very required for many others. I think it should be implemented in the “roles” settings, with the checkboxes, where you would simply have an input allowing you to limit the number of items a role can add.
Thanks.