Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of Cancancan_accessible_by_action -- removed #331

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

foton
Copy link
Contributor

@foton foton commented Nov 11, 2024

  1. Nahradil jsem používání folio_records.accessible_by(current_ability, self.class.cancancan_accessible_by_action) za
    folio_records.accessible_by(current_ability) , což při použití load_and_authorize_resource je totéž jako folio_records .
    Tj. načítají se záznamy povolené uživateli pro danou akci controlleru.
    Pokud je tam nějaká specifická mimo CRUD, je potřeba ji nastavit v abilitách.

  2. Některé helpery pro consoli jsem upravil tak, aby si sami kontrolovali, jestli na danou akci má uživatel právo či nikoliv.
    A podle toho buď zobrazili input nebo jen read-only input.
    Např upublished_toggle se místo toggle zobrazí jen "Ano" nebo "Ne", pokud nemáte právo to měnit.
    U zatržítek se input zobrazí, ale je disabled.

Pro "sorting" je potřeba mít právo :update. A právo na set_xxx_positions pro patřičný model (podle metody volané skrz XHR)

@foton foton requested a review from mreq November 11, 2024 14:55
@mreq mreq merged commit 95a7eea into master Nov 12, 2024
@mreq mreq deleted the cancancan_accessible_by_action___removed branch November 12, 2024 05:35
@mreq
Copy link
Member

mreq commented Nov 12, 2024

super 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants