UserPermission for multiple entity types, sets per...
# package-development
w
With the UserPermission stuff you showed at CG @Niels Lyngsø & @Jacob Overgaard I am not sure this is a bug/intended feature or not... I have the permission defined for both document and media as the entity type and toggling one, toggles the other to be enabled as well etc... https://cdn.discordapp.com/attachments/882984798719729704/1252600896005869658/image.png?ex=6672cefd&is=66717d7d&hm=f436232dcae64755abd12a9ebb0d59123f5c1f8cc7ed303543b7c785fc25db09&
Copy code
typescript
import { UMB_DOCUMENT_ENTITY_TYPE } from "@umbraco-cms/backoffice/document";
import { UMB_MEDIA_ENTITY_TYPE } from "@umbraco-cms/backoffice/media";
import { ManifestEntityUserPermission } from "@umbraco-cms/backoffice/extension-registry";

const examinePeekPermission: ManifestEntityUserPermission = {
    type: 'entityUserPermission',
    alias: 'examinepeek.permission',
    name: 'Examine Peek User Permission',
    forEntityTypes: [ UMB_DOCUMENT_ENTITY_TYPE, UMB_MEDIA_ENTITY_TYPE ],
    weight: -1000,
    meta: {
        verbs: ['ExaminePeek.Enabled'], // This is key persissted back to server & what we look up in condition
        group: 'Examine Peek',
        label: 'Enable Examine Peek',
        description: 'Allows a user to peek at the stored Examine values in the index for a given piece of content.'
    }
}
export const manifests = [examinePeekPermission];
My understanding it would be that each toggle would be independent from each other. Meaning I could set the user group to be enabled to view this in documents/content but not media
n
yes, I think your right. 🙂 cause the Verb is begin set for the entity type, or for the specific node, if you setup granular permissions.
w
So a bug then??
n
Erhm, well, we would have to ask Mads or Bjarke to get that clarified. But from my understadning of the system yes. Could you create it as a issue 🙂 thanks
w
OK - off to create an issue then...
@Niels Lyngsø @madsrasmussen_ or @Bjarke Berg one issue reported for you to let me know https://github.com/umbraco/Umbraco.CMS.Backoffice/issues/2012
5 Views