cooptilleuls / cooptilleulsaclsonataadminextensionbundle Goto Github PK
View Code? Open in Web Editor NEWACL list filtering for SonataAdmin
Home Page: http://les-tilleuls.coop
License: MIT License
ACL list filtering for SonataAdmin
Home Page: http://les-tilleuls.coop
License: MIT License
I am trying to get this for whole user group(roles in it) rather than each user (one by one)
Every user in group has same rights(and view only his items)
how can I do it?
thanks
I try to install it with Symfony 3.2 but can't. It wants Sonata 2.2 and Symfony 3 wants Sonata 3.x
The line:
"symfony/symfony": ">=2.2,<2.4-dev",
doesn't allow me use this bundle. Is this bundle compatible with Symfony 2.4?
i have a table with id different from usual "id", let's say i call the field table_id
well, it's not compatible with the bundle because in file CoopTilleuls\Bundle\AclSonataAdminExtensionBundle\Admin\AclAdminExtension line 99 you wrote :
->andWhere('o.id IN (:ids)')
it triggers a Doctrine Exception since my table with alias "o" has no field called id
fixed it temporary with
->andWhere('o IN (:ids)')
works fine :)
hope i'll get a proper fix next update
The extension seems not to be compatible with sonata-project/SonataAdminBundle#2600
Symfony let users customize their ACL table names. These are available via container's parameters.
However, table names are hardcoded in this bundle (here for example).
It should be better to use the previously mentionned parameters instead of hardcoded table names.
MaskBuilder
masks are hardcoded here.
Also, masks used to determine if the VIEW
permission is granted are usually determined with the PermissionMap
.
However, since the masks are hardcoded, the permission map is ignored.
I will open a PR to fix this.
Please update the composer.json to support Sonata Admin 3.x
Thanks in advance.
Hi,
With this bundle, the Sonata command line "sonata:admin:explain" cause a fatal error (Security context is not available through command line) :
PHP Fatal error: Call to a member function getUser() on a non-object in /Users/fabien/Workspaces/Sites/sandbox.dev/vendor/tilleuls/acl-sonata-admin-extension-bundle/CoopTilleuls/Bundle/AclSonataAdminExtensionBundle/Admin/AclAdminExtension.php on line 50
May be a simple patch like this can solve the issue :
https://gist.github.com/FabienD/8221873
Regards,
Fabien
Hello, I am trying to use this bundle but it just hides ALL the items from the list except the items created by the owner, what am I doing wrong?
config.yml
sonata_admin:
security:
handler: sonata.admin.security.handler.acl
role_admin: ROLE_ADMIN
role_super_admin: ROLE_SUPER_ADMIN
# acl security information
information:
GUEST: [VIEW, LIST]
STAFF: [EDIT, LIST, CREATE]
EDITOR: [OPERATOR, EXPORT]
ADMIN: [MASTER]
# permissions not related to an object instance and also to be available when objects do not exist
# the DELETE admin permission means the user is allowed to batch delete objects
admin_permissions: [CREATE, LIST, DELETE, UNDELETE, EXPORT, OPERATOR, MASTER]
# permission related to the objects
object_permissions: [VIEW, EDIT, DELETE, UNDELETE, OPERATOR, MASTER, OWNER]
security.yml
security:
role_hierarchy:
ROLE_ADMIN:
- ROLE_USER
- ROLE_SONATA_ADMIN
- ROLE_APP_ADMIN_PRODUCT_FAMILY_EDITOR
- ROLE_APP_ADMIN_PRODUCT_EDITOR
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
#SONATA:
#- ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT # if you are using acl then this line must be commented
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
providers:
fos_userbundle:
id: fos_user.user_provider.username
When I log in as a ROLE_ADMIN I see the product family list empty except for the items I created myself.
Thanks.
I have a bundle like the SonataProductBundle where in the sandbox "Travels" and "Goodies" entities have the "Product" entity as parent. When I enable the AclSonataAdminExtension and go to the ProductAdmin, I have an empty list of Products (even if I am OWNER of a list of sub-entities Travels & Goodies for example) because the Acl is managed at the entity level I guess.
Is there a way to avoid this ?
Is is possible filter sonata_type_model list
I every one,
First thanks for sharing this awesome bundle !
I have and idea for enhance the code : filter child entity from parent ACL (optionnal).
Exemple an application with 2 tables (Category and Product) a user who have OPERATOR ACL access to a specific category can view only the products of this category.
I will try to do this but if somebody have some good ideas ?
My problem is i don't know how i can make it optionnal (how i can param it) and how i can specify wich parent entity to choose for filtering.
If i success to code it i will send it tou you for merge.
Bye
I'm using symfony 2.2.11 and sonatadminbundle 2.2, I thinks it is not the last version, this is the return from composer show -i
sonata-project/admin-bundle dev-master be78c78 Symfony SonataAdminBundle
When I run to ACL option I don't get any filters in the users list. I've add the entry in composer.json, updated it and add the entry in AppKernel with the cache clear, but still without any filters in acl user list. What can I do?
Maybe is something related to my Postgresql connection...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.