What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

hello all, How does `can` twig function work? for example the permission `SeeOrderPlaceSubmitPermis

UM9F81RCP
UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

hello all,

How does can twig function work? for example the permission SeeOrderPlaceSubmitPermissionPluginwhere can I assign it to the user in Zed?

Thanks alot

Comments

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    /**
     * Implements a general check for a chosen permission with the provided context
     *
     * Specification:
     * - Finds a permission key in a user session
     * - Finds a related to the permission key plugin
     * - If plugin is not found - return TRUE
     * - If the plugins is not executable - return true
     * - If the plugin is executable - returns boolean result of the execution
     *
     * @api
     *
     * @param string $permissionKey
     * @param string|int|array|null $context
     *
     * @return bool
     */
    public function can($permissionKey, $context = null): bool;
    

    what can() actually calls inside
    $permissionKey is plugin name
    $context is data provided to plugin

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I saw that one

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    but it still does not make sense to me how does it work for some users not for others … and it has inconsistent behaviour on different environment !

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks for the docs

  • Stanislav Matveyev
    Stanislav Matveyev Tech Lead @ Spryker Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    hope it will help