Cutting corners from a wheel -

K
CUTTING CORNERS
 FROM A WHEEL
    // Forkito ACL //




                        FORKITO
FINAL GOAL

Easy to use and understand ACL system

Reusable ACL library compatible with most widespread Joomla
based projects




                                                              FORKITO
FORKITO ACL FLAVORS

 Ţ Joomla fork flavor (working - oh yeah)
 Ţ Molajo flavor (in progress)
 Ţ Nooku flavor (planned)




                                            FORKITO
JOOMLA FORK FLAVOR




                     FORKITO
JOOMLA FORK FLAVOR



Did he really say that?


                                  FORKITO
JOOMLA FORK FLAVOR

Starting point for the whole project.

Used as proof of concept




                                        FORKITO
Joomla fork form == contains changes to 70+ files
 due to poor Joomla ACL implementation in application layer

 Joomla - ACL hardcoded everywhere




revision 7




                                                              FORKITO
COVERED PARTS

New forkito ACL library
Joomla library methods are changed to proxies to a new library
methods

Includes internal methods that take care of backwards
compatibility with old Joomla ACL




                                                                 FORKITO
COVERED PARTS

Web application framework layer
 Ţ categories
 Ţ menus,
 Ţ modules,
 Ţ plugins

Mainly changes to multiple items queries




                                           FORKITO
COVERED PARTS

Application
 Ţ Backend components: com_categories, com_menus,
    com_modules, com_plugins
 Ţ Content components: com_content (back and frontend)
 Ţ Pagenavigation plugin-

Contains changes to 37 php and 15 xml files,
most extensive changes to com_users and com_content




                                                         FORKITO
WHERE I CAN GET IT

git clone git://git.forkito.org/forkito




                                          FORKITO
MOLAJO FLAVOR




                FORKITO
Completely new classes

Where most development goes at the moment

The most important part




                                            FORKITO
Molajo   ?   - web application layer will be completely redone
together with components - layer includes hooks for ACL plugins

Just few library overrides (JUser, JCategories, JMenu … )

Joomla compatibility methods removed – extension either uses
Joomla or Forkito ACL




                                                                  FORKITO
Molajo   ?   - web application layer will be completely redone
together with components - layer includes hooks for ACL plugins

Just few library overrides (JUser, JCategories, JMenu … )

Joomla compatibility methods removed – extension either uses
Joomla or Forkito ACL


                yes, it can be done




                                                                  FORKITO
NOOKU FLAVOR




               FORKITO
Will come after Molajo flavour

it is expected that only minor changes will be needed in Forkito
ACl for it to work with Nooku framework.

Forkito will represent an addon library here




                                                                   FORKITO
Unified ACL
// Forkito to Joomla ACL comparision//




                                         FORKITO
REMOVED VIEW ACCESS LEVELS AND ADDED VIEW TO
ACTIONS

50% less users effort needed, 50% less complicated.

View == action

No need for a separate ACL system for managing view permissions.
onfusing for the user and inefficient from the system point of view.




                                                                  FORKITO
RADICALLY IMPROVED AND SIMPLIFIED USER INTERFACE

 Ţ Simple matryx of groups and actions
 Ţ One-click permission changes
 Ţ Instantly visible changes in inherited values




                                                   FORKITO
SIMPLIFIED OPERATIONAL LOGIC

Lower level always wins
Global >Component>(Category)>(Item)

Anything set on the lower level beats what was set on the higher
one (denied or allowed)

Assigned permission beats inherited
Users are auto assigned to parent groups, so anything that is set in
parents will affect user's permissions, but only if it is not set
explicitly in assigned groups.



                                                                   FORKITO
SIMPLIFIED OPERATIONAL LOGIC

If one group gives you access you are in
(key analogy)

If you have a key that opens certain doors, it doesn't matter if
another key doesn't work, you still can get in.
When user is allowed to do something trough his membership in
one of the assigned groups, all others are irrelevant.




                                                                   FORKITO
DRY-ED AND RE-ARCHITECTURED

No code repetition
A single method for a single purpose.
Classes reusing other classes methods and not replicating them.
Very low amount of code, will cut off even more in the future.




                                                                  FORKITO
JSON ENCODED RULES REPLACED WITH PERMISSIONS
TABLE

JSON encoded string of permissions, stored in simgle database
field was one of the most horrible ideas ever seen in Joomla

This kind of code crimes should be punishable with at least 100 hits
with a stick.




                                                                  FORKITO
WHY ?
    FORKITO
It totally disables any database relations, conditional searches etc.
with enormous impact on performance.




                                                                    FORKITO
To retrieve a list of items user has a permission to view (or edit or
do any action) code would need to query for ALL items, unpack
json string item by item and check permissions each item
separately.

Now imagine you have 100.000 or even 1 million items to inspect
one by one and try to imagine how long that would take and e.g.
how much memory it would consume.

Get the picture?




                                                                        FORKITO
Having JSON in a database == a performance problem

=> you need more efficient system for managing thousands of
users trying to view pages

=> you "solve" the problem by inventing another ACL system
called access levels




                                                              FORKITO
ALWAYS PRESENT BASIC SYSTEM GROUPS

Groups that cannot be removed or their role changed

While this might seem like a backwards step, this groups are really
corner stones that CMS ACL cannot work without. Equivalent to
unix wheel and anonymous groups roles.

Having groups system can always rely on -> RELIABILITY,
better performance and better security

// including root configuration hack that is not need anymore //



                                                                   FORKITO
ALWAYS PRESENT BASIC SYSTEM GROUPS

Everyone
- Not-authenticated - anonymous visitors
- Authenticated – anyone that is logged in
-- Admins – replacing global core.admin permission (equivalent to
unix wheel group)




                                                                    FORKITO
Simple API
// Hod do I implement it //




                              FORKITO
API GOAL

Create minimal number of humanly understandable (self
explaining) classes and method names.




                                                        FORKITO
CHECK AUTHORIZATION - MACCESS CLASS

Check single item's authorization :

isUserAuthorizedTo

+ shortcut: isUserAuthorisedToView




                                      FORKITO
CHECK AUTHORIZATION - MACCESS CLASS

Check multiple items authorization (by automatically inserting
filtering sql in multiple items queries):

insertFilterQuery




                                                                 FORKITO
MULTIPLE ITEMS AUTHORIZATION EXAMPLE

JPluginHelper::_load()

Joomla
$levels = implode(',', $user->getAuthorisedViewLevels());
...
$query->select('folder AS type, element AS name, params')
->from('#__extensions')
->where('enabled >= 1')
->where('type ='.$db->Quote('plugin'))
->where('state >= 0')
->where('access IN ('.$levels.')')
->order('ordering');




                                                            FORKITO
MULTIPLE ITEMS AUTHORIZATION EXAMPLE

Forkito ACL

$query->select('e.folder AS type, e.element AS name, e.params, e.extension_id,
e.asset_id')
->from('#__extensions AS e')
->where('enabled >= 1')
->where('type ='.$db->Quote('plugin'))
->where('state >= 0')
->order('ordering');

jimport('molajo.access.access');
MAccess::insertFilterQuery($db, $query, 'e.asset_id', 'core.view');



                                                                                 FORKITO
MULTIPLE ITEMS AUTHORIZATION EXAMPLE

The same function is used in categories helper, modules helper,
com_content articles model – anywhere where list of items needs
to be filtered




                                                                  FORKITO
USER INTERFACE

Insert acl widget HTML: MHtmlPermissions::aclWidget

Get ready-made acl widget in shape of Joomla form field:
MFormFieldAclwidget

Very simple to include ACL widget in your component layout




                                                             FORKITO
Future
// Short term //




                   FORKITO
Testing, testing. Bugfixing.
Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing.
Testing, testing. Bugfixing.
Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing.
Testing, testing. Bugfixing.
Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing.
Testing, testing. Bugfixing.
Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing.
Testing, testing. Bugfixing.
Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing.
Testing, testing. Bugfixing.
Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing.



                                                              FORKITO
USER INTERFACE IMPROVEMENT

Inheritance breadcrumbs - show what this level is inheriting from




                                                                FORKITO
Future
// Long term //




                  FORKITO
MORE ROUNDS OF SIMPLIFICATION

Simple mode - flatten inheritance , keep only default and category
(or item) permissions




                                                                     FORKITO
1 of 43

Recommended

Applet by
 Applet Applet
Appletswapnac12
76 views10 slides
Awt, Swing, Layout managers by
Awt, Swing, Layout managersAwt, Swing, Layout managers
Awt, Swing, Layout managersswapnac12
290 views55 slides
IPaste SDK v.1.0 by
IPaste SDK v.1.0IPaste SDK v.1.0
IPaste SDK v.1.0xrebyc
231 views11 slides
Design pattern in Symfony2 - Nanos gigantium humeris insidentes by
Design pattern in Symfony2 - Nanos gigantium humeris insidentesDesign pattern in Symfony2 - Nanos gigantium humeris insidentes
Design pattern in Symfony2 - Nanos gigantium humeris insidentesGiulio De Donato
32K views57 slides
Using Contexts & Dependency Injection in the Java EE 6 Platform by
Using Contexts & Dependency Injection in the Java EE 6 PlatformUsing Contexts & Dependency Injection in the Java EE 6 Platform
Using Contexts & Dependency Injection in the Java EE 6 PlatformArun Gupta
3.4K views62 slides
Utilize the Full Power of GlassFish Server and Java EE Security by
Utilize the Full Power of GlassFish Server and Java EE SecurityUtilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityMasoud Kalali
4K views39 slides

More Related Content

Viewers also liked

Molajo - Joomla based distributions by
Molajo - Joomla based distributionsMolajo - Joomla based distributions
Molajo - Joomla based distributionskauselot
911 views60 slides
Regents Bangkok by
Regents BangkokRegents Bangkok
Regents Bangkokjhortop
348 views12 slides
Turbocharging your extension // Joomla // by
Turbocharging your extension // Joomla //Turbocharging your extension // Joomla //
Turbocharging your extension // Joomla //kauselot
1.7K views77 slides
Kis Sc by
Kis ScKis Sc
Kis Scjhortop
301 views5 slides
Disney World 2010v4 by
Disney World 2010v4Disney World 2010v4
Disney World 2010v4ChristinaCo
308 views15 slides
Disney World 2010v3 by
Disney World 2010v3Disney World 2010v3
Disney World 2010v3ChristinaCo
383 views15 slides

Viewers also liked(7)

Molajo - Joomla based distributions by kauselot
Molajo - Joomla based distributionsMolajo - Joomla based distributions
Molajo - Joomla based distributions
kauselot911 views
Regents Bangkok by jhortop
Regents BangkokRegents Bangkok
Regents Bangkok
jhortop348 views
Turbocharging your extension // Joomla // by kauselot
Turbocharging your extension // Joomla //Turbocharging your extension // Joomla //
Turbocharging your extension // Joomla //
kauselot1.7K views
Kis Sc by jhortop
Kis ScKis Sc
Kis Sc
jhortop301 views
Disney World 2010v4 by ChristinaCo
Disney World 2010v4Disney World 2010v4
Disney World 2010v4
ChristinaCo308 views
Disney World 2010v3 by ChristinaCo
Disney World 2010v3Disney World 2010v3
Disney World 2010v3
ChristinaCo383 views
Joomla 1.6. caching implemented #jab11 by kauselot
Joomla 1.6. caching implemented #jab11Joomla 1.6. caching implemented #jab11
Joomla 1.6. caching implemented #jab11
kauselot1.1K views

Similar to Cutting corners from a wheel -

Enrich your extensions with Joomla! ACL support by
Enrich your extensions with Joomla! ACL supportEnrich your extensions with Joomla! ACL support
Enrich your extensions with Joomla! ACL supportSander Potjer
7.2K views65 slides
Justin Herrin Comparing Joomla CCKs from jd12ne by
Justin Herrin Comparing Joomla CCKs from jd12neJustin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin Comparing Joomla CCKs from jd12neJustin Herrin
2.1K views42 slides
Using spl tools in your code by
Using spl tools in your codeUsing spl tools in your code
Using spl tools in your codeElizabeth Smith
1.2K views50 slides
What is the Joomla Framework and why do we need it? by
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?Rouven Weßling
1.5K views42 slides
Dolibarr module development by
Dolibarr module developmentDolibarr module development
Dolibarr module developmentRajib Hossain Pavel
554 views4 slides
David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compat... by
David Rey   Lessons Learned   Updating Content Licensing To Be Plone 3 Compat...David Rey   Lessons Learned   Updating Content Licensing To Be Plone 3 Compat...
David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compat...Vincenzo Barone
2.3K views34 slides

Similar to Cutting corners from a wheel - (20)

Enrich your extensions with Joomla! ACL support by Sander Potjer
Enrich your extensions with Joomla! ACL supportEnrich your extensions with Joomla! ACL support
Enrich your extensions with Joomla! ACL support
Sander Potjer7.2K views
Justin Herrin Comparing Joomla CCKs from jd12ne by Justin Herrin
Justin Herrin Comparing Joomla CCKs from jd12neJustin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin Comparing Joomla CCKs from jd12ne
Justin Herrin2.1K views
What is the Joomla Framework and why do we need it? by Rouven Weßling
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?
Rouven Weßling1.5K views
David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compat... by Vincenzo Barone
David Rey   Lessons Learned   Updating Content Licensing To Be Plone 3 Compat...David Rey   Lessons Learned   Updating Content Licensing To Be Plone 3 Compat...
David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compat...
Vincenzo Barone2.3K views
jQuery Tips Tricks Trivia by Cognizant
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
Cognizant3.2K views
Railo Presentation Railo 3.1 by Rhinofly
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
Rhinofly418 views
Introduction to building joomla! components using FOF by Tim Plummer
Introduction to building joomla! components using FOFIntroduction to building joomla! components using FOF
Introduction to building joomla! components using FOF
Tim Plummer49.9K views
Alfresco monitoring with Nagios and ELK stack by Cesar Capillas
Alfresco monitoring with Nagios and ELK stackAlfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stack
Cesar Capillas1.4K views
Mageguru - magento custom module development by Mage Guru
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
Mage Guru70 views
Understanding Framework Architecture using Eclipse by anshunjain
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
anshunjain951 views
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012 by Sabuj Kundu
Developing Joomla Extensions JUG  Bangladesh meetup dhaka-2012Developing Joomla Extensions JUG  Bangladesh meetup dhaka-2012
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
Sabuj Kundu1.1K views
LOGBack and SLF4J by jkumaranc
LOGBack and SLF4JLOGBack and SLF4J
LOGBack and SLF4J
jkumaranc3 views
LOGBack and SLF4J by jkumaranc
LOGBack and SLF4JLOGBack and SLF4J
LOGBack and SLF4J
jkumaranc3.2K views
LOGBack and SLF4J by jkumaranc
LOGBack and SLF4JLOGBack and SLF4J
LOGBack and SLF4J
jkumaranc560 views
LOGBack and SLF4J by jkumaranc
LOGBack and SLF4JLOGBack and SLF4J
LOGBack and SLF4J
jkumaranc1.2K views
Improved Joomla! 3.6 Updates by SynapseIndia
Improved Joomla! 3.6 UpdatesImproved Joomla! 3.6 Updates
Improved Joomla! 3.6 Updates
SynapseIndia41 views

Recently uploaded

SUPPLIER SOURCING.pptx by
SUPPLIER SOURCING.pptxSUPPLIER SOURCING.pptx
SUPPLIER SOURCING.pptxangelicacueva6
20 views1 slide
Kyo - Functional Scala 2023.pdf by
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
418 views92 slides
PRODUCT PRESENTATION.pptx by
PRODUCT PRESENTATION.pptxPRODUCT PRESENTATION.pptx
PRODUCT PRESENTATION.pptxangelicacueva6
18 views1 slide
Democratising digital commerce in India-Report by
Democratising digital commerce in India-ReportDemocratising digital commerce in India-Report
Democratising digital commerce in India-ReportKapil Khandelwal (KK)
20 views161 slides
Case Study Copenhagen Energy and Business Central.pdf by
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdfAitana
17 views3 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
22 views27 slides

Recently uploaded(20)

Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana17 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty22 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker48 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays24 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi139 views

Cutting corners from a wheel -

  • 1. CUTTING CORNERS FROM A WHEEL // Forkito ACL // FORKITO
  • 2. FINAL GOAL Easy to use and understand ACL system Reusable ACL library compatible with most widespread Joomla based projects FORKITO
  • 3. FORKITO ACL FLAVORS Ţ Joomla fork flavor (working - oh yeah) Ţ Molajo flavor (in progress) Ţ Nooku flavor (planned) FORKITO
  • 5. JOOMLA FORK FLAVOR Did he really say that? FORKITO
  • 6. JOOMLA FORK FLAVOR Starting point for the whole project. Used as proof of concept FORKITO
  • 7. Joomla fork form == contains changes to 70+ files due to poor Joomla ACL implementation in application layer Joomla - ACL hardcoded everywhere revision 7 FORKITO
  • 8. COVERED PARTS New forkito ACL library Joomla library methods are changed to proxies to a new library methods Includes internal methods that take care of backwards compatibility with old Joomla ACL FORKITO
  • 9. COVERED PARTS Web application framework layer Ţ categories Ţ menus, Ţ modules, Ţ plugins Mainly changes to multiple items queries FORKITO
  • 10. COVERED PARTS Application Ţ Backend components: com_categories, com_menus, com_modules, com_plugins Ţ Content components: com_content (back and frontend) Ţ Pagenavigation plugin- Contains changes to 37 php and 15 xml files, most extensive changes to com_users and com_content FORKITO
  • 11. WHERE I CAN GET IT git clone git://git.forkito.org/forkito FORKITO
  • 12. MOLAJO FLAVOR FORKITO
  • 13. Completely new classes Where most development goes at the moment The most important part FORKITO
  • 14. Molajo ? - web application layer will be completely redone together with components - layer includes hooks for ACL plugins Just few library overrides (JUser, JCategories, JMenu … ) Joomla compatibility methods removed – extension either uses Joomla or Forkito ACL FORKITO
  • 15. Molajo ? - web application layer will be completely redone together with components - layer includes hooks for ACL plugins Just few library overrides (JUser, JCategories, JMenu … ) Joomla compatibility methods removed – extension either uses Joomla or Forkito ACL yes, it can be done FORKITO
  • 16. NOOKU FLAVOR FORKITO
  • 17. Will come after Molajo flavour it is expected that only minor changes will be needed in Forkito ACl for it to work with Nooku framework. Forkito will represent an addon library here FORKITO
  • 18. Unified ACL // Forkito to Joomla ACL comparision// FORKITO
  • 19. REMOVED VIEW ACCESS LEVELS AND ADDED VIEW TO ACTIONS 50% less users effort needed, 50% less complicated. View == action No need for a separate ACL system for managing view permissions. onfusing for the user and inefficient from the system point of view. FORKITO
  • 20. RADICALLY IMPROVED AND SIMPLIFIED USER INTERFACE Ţ Simple matryx of groups and actions Ţ One-click permission changes Ţ Instantly visible changes in inherited values FORKITO
  • 21. SIMPLIFIED OPERATIONAL LOGIC Lower level always wins Global >Component>(Category)>(Item) Anything set on the lower level beats what was set on the higher one (denied or allowed) Assigned permission beats inherited Users are auto assigned to parent groups, so anything that is set in parents will affect user's permissions, but only if it is not set explicitly in assigned groups. FORKITO
  • 22. SIMPLIFIED OPERATIONAL LOGIC If one group gives you access you are in (key analogy) If you have a key that opens certain doors, it doesn't matter if another key doesn't work, you still can get in. When user is allowed to do something trough his membership in one of the assigned groups, all others are irrelevant. FORKITO
  • 23. DRY-ED AND RE-ARCHITECTURED No code repetition A single method for a single purpose. Classes reusing other classes methods and not replicating them. Very low amount of code, will cut off even more in the future. FORKITO
  • 24. JSON ENCODED RULES REPLACED WITH PERMISSIONS TABLE JSON encoded string of permissions, stored in simgle database field was one of the most horrible ideas ever seen in Joomla This kind of code crimes should be punishable with at least 100 hits with a stick. FORKITO
  • 25. WHY ? FORKITO
  • 26. It totally disables any database relations, conditional searches etc. with enormous impact on performance. FORKITO
  • 27. To retrieve a list of items user has a permission to view (or edit or do any action) code would need to query for ALL items, unpack json string item by item and check permissions each item separately. Now imagine you have 100.000 or even 1 million items to inspect one by one and try to imagine how long that would take and e.g. how much memory it would consume. Get the picture? FORKITO
  • 28. Having JSON in a database == a performance problem => you need more efficient system for managing thousands of users trying to view pages => you "solve" the problem by inventing another ACL system called access levels FORKITO
  • 29. ALWAYS PRESENT BASIC SYSTEM GROUPS Groups that cannot be removed or their role changed While this might seem like a backwards step, this groups are really corner stones that CMS ACL cannot work without. Equivalent to unix wheel and anonymous groups roles. Having groups system can always rely on -> RELIABILITY, better performance and better security // including root configuration hack that is not need anymore // FORKITO
  • 30. ALWAYS PRESENT BASIC SYSTEM GROUPS Everyone - Not-authenticated - anonymous visitors - Authenticated – anyone that is logged in -- Admins – replacing global core.admin permission (equivalent to unix wheel group) FORKITO
  • 31. Simple API // Hod do I implement it // FORKITO
  • 32. API GOAL Create minimal number of humanly understandable (self explaining) classes and method names. FORKITO
  • 33. CHECK AUTHORIZATION - MACCESS CLASS Check single item's authorization : isUserAuthorizedTo + shortcut: isUserAuthorisedToView FORKITO
  • 34. CHECK AUTHORIZATION - MACCESS CLASS Check multiple items authorization (by automatically inserting filtering sql in multiple items queries): insertFilterQuery FORKITO
  • 35. MULTIPLE ITEMS AUTHORIZATION EXAMPLE JPluginHelper::_load() Joomla $levels = implode(',', $user->getAuthorisedViewLevels()); ... $query->select('folder AS type, element AS name, params') ->from('#__extensions') ->where('enabled >= 1') ->where('type ='.$db->Quote('plugin')) ->where('state >= 0') ->where('access IN ('.$levels.')') ->order('ordering'); FORKITO
  • 36. MULTIPLE ITEMS AUTHORIZATION EXAMPLE Forkito ACL $query->select('e.folder AS type, e.element AS name, e.params, e.extension_id, e.asset_id') ->from('#__extensions AS e') ->where('enabled >= 1') ->where('type ='.$db->Quote('plugin')) ->where('state >= 0') ->order('ordering'); jimport('molajo.access.access'); MAccess::insertFilterQuery($db, $query, 'e.asset_id', 'core.view'); FORKITO
  • 37. MULTIPLE ITEMS AUTHORIZATION EXAMPLE The same function is used in categories helper, modules helper, com_content articles model – anywhere where list of items needs to be filtered FORKITO
  • 38. USER INTERFACE Insert acl widget HTML: MHtmlPermissions::aclWidget Get ready-made acl widget in shape of Joomla form field: MFormFieldAclwidget Very simple to include ACL widget in your component layout FORKITO
  • 39. Future // Short term // FORKITO
  • 40. Testing, testing. Bugfixing. Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing. Testing, testing. Bugfixing. Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing. Testing, testing. Bugfixing. Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing. Testing, testing. Bugfixing. Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing. Testing, testing. Bugfixing. Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing. Testing, testing. Bugfixing. Testing. Bugfixing. Bugfixing. Testing. Testing. Bugfixing. FORKITO
  • 41. USER INTERFACE IMPROVEMENT Inheritance breadcrumbs - show what this level is inheriting from FORKITO
  • 42. Future // Long term // FORKITO
  • 43. MORE ROUNDS OF SIMPLIFICATION Simple mode - flatten inheritance , keep only default and category (or item) permissions FORKITO