Download - Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Transcript
Page 1: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Make your extension more powerful by

implementing Joomla ACL

Sander Potjer - @sanderpotjer www.aclmanager.net

J and Beyond 2014

Page 2: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 3: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Sander Potjer

Extension: ACL Manager Joomla Agency: Perfect Web Team

I love Joomla

Page 4: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Sander Potjer

Extension: ACL Manager Joomla Agency: Perfect Web Team

I love Joomla Slides: slideshare.net/sanderpotjer

Page 5: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 6: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 7: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Photo by: Mark Fischer

Joomla ACL

Page 8: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

ACL?!?!ACL = Access Control List

!

!

!

!

!

!

!

Page 9: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

ACL?!?!ACL = Access Control List

!

1) Visibility of content !

!

!

!

!

Page 10: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

ACL?!?!ACL = Access Control List

!

1) Visibility of content !

!

!

!

2) Actions on objects

Page 11: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 12: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Photo by: Chris Smith

Overview

Page 13: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user

Page 14: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

Page 15: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions permissions !

Site Login Admin Login

Offline Access Super Admin / Configure Access Admin. Interface

Create Delete

Edit Edit State Edit Own

Page 16: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

group

Page 17: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelgroup

Page 18: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelgroup

Page 19: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelgroup

Page 20: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelgroup

Page 21: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelgroup

Page 22: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelgroup

Page 23: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

user permissions

access levelrole

Page 24: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

ACL levels

Photo by: Ian Sane

Page 25: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

Page 26: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Photo by: Andreas

Inheritance

Page 27: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

Page 28: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

Page 29: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

not set

inherited

inherited

inherited

Page 30: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

allowed

inherited

inherited

inherited

Page 31: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

allowed

inherited

denied

locked

Page 32: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

not set

allowed

inherited

inherited

Page 33: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

not set

inherited

allowed

inherited

Page 34: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

denied

allowed

locked

locked

Page 35: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Global Configuration permissions

Component permissions

Category / Module permissions

Article permissions

denied

allowed

locked

locked

CONFLICT

Page 36: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 37: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Why?

Photo by: jon jordan

Page 38: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Why not!

Photo by: Peter Reed

Page 39: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Usability

Photo by: Rick Dolishny

Page 40: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Don’t make me think

Photo by: Alper Çuğun

Page 41: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 42: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 43: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Basic ACL implementation

Photo by: Daniel Kulinski

Page 44: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 45: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Configure To configure the access settings via the 'Options'

toolbar button !

Access Administration Interface To define which group is able to access/manage the

component

2 actions required

Page 46: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

4 steps 18 lines of code couple minutes

Page 47: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Add actions 1

Page 48: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/config.xml

Page 49: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Access check 2

Page 50: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/foobar.php

Page 51: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

‘Options’ toolbar button3

Page 52: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/views/foobars/view.html.php

Page 53: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/views/foobars/view.html.php

Page 54: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Add language string 4

Page 55: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/language/en-GB/en-GB.com_foobar.ini

Page 56: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Done!

Page 57: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Basic ACL support is not optional, it is a

requirement for any Joomla extension!

Page 58: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Advanced ACL implementation

Photo by: Patrick Lauke

Page 59: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Database

Page 60: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 61: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Rules - JSON encoded

{"core.login.site":{"6":1,"2":1}

Page 62: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

com_content.article.24 [extension].[section].[object id]

Action name format (database)

Page 63: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 64: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

JTable

Page 65: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 66: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Access.xml

Page 67: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/config.xml

Page 68: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 69: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 70: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 71: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 72: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 73: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Component permissions

Category / Module permissions

Article permissions

Page 74: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 75: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Site Login: core.login.site Admin Login: core.login.admin

Offline Access: core.login.offline Super Admin / Configure: core.admin

Access Administration Interface: core.manager Create: core.create Delete: core.delete

Edit: core.edit Edit State: core.edit.state Edit Own: core.edit.own

Title vs Name

Page 76: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Page 77: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_content/access.xml

Component permissions

Category / Module permissions

Article permissions

allowed

inherited

inherited

Page 78: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 79: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Custom Actions

Page 80: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 81: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_akeeba/access.xml

Page 82: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_akeeba/access.xml

Page 83: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_akeeba/access.xml

Page 84: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_akeeba/access.xml

Page 85: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_akeeba/access.xml

Page 86: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Action name format (xml)

akeeba.backup [name extension].[name action]

Page 87: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Keep it structured

Page 88: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 89: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Interface

Page 90: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014
Page 91: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/views/foobar/tmpl/edit.php

Page 92: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

getActions helper

Page 93: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: libraries/cms/helper/content.php

Page 94: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: can be used anywhere

Page 95: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: can be used anywhere

Page 96: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

addToolbar

Page 97: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/views/foobars/view.html.php

Page 98: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

File: administrator/components/com_foobar/views/foobars/view.html.php

Page 99: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Resources

Photo by: Schub@

Page 100: Make your extension more powerful by implementing Joomla ACL - J and Beyond 2014

Is your extension really Joomla 1.7 ready?http://www.aclmanager.net/news/general/28-is-your-extension-really-joomla-17-ready

!How to add basic ACL support to your extension

http://www.aclmanager.net/news/general/31-how-to-add-basic-acl-support-to-your-extension

Developing a MVC Component/Adding ACL http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_ACL

Adding ACL rules to your component http://docs.joomla.org/Adding_ACL_rules_to_your_component

!Access Control List Tutorial

http://docs.joomla.org/J2.5:Access_Control_List_Tutorial !

Support for ACL permissions per module in com_modules https://github.com/joomla/joomla-cms/pull/1930/files

!JHelperContent::getActions() improvements

https://github.com/joomla/joomla-cms/pull/2728 !

This presentation http://slideshare.net/sanderpotjer/