SlideShare a Scribd company logo
Zend Acl
Presented By
Rajanikant Beero
Table of Contents
● What is Acl?
● Zend & Basic Set Up
● Components of Acl(Zend)
● Resources in Acl
● Roles in Acl
● Creating a simple Acl with example
● Storing ACL Data for Persistence
● Conditional ACL Rules with Assertions
● Benefits
What is Acl?
● The functionality of specifying access rights to
resources is access control.
● An ACL specifies which users or system processes
are granted access to resources, as well as what
operations are allowed on given resource.
● An access control list (ACL), with respect to a
computer file system is a list of permissions attached
to the files.
Zend & Basic Set Up
● Zend Framework is an open source, object oriented
web application framework for PHP 5.
● Zend is often called a 'component library', because
it has many components that you can use more or
less independently.
● Provides Model-View-Controller (MVC)
implementation.
● Basic set up can be found here -
http://framework.zend.com/manual/1.12/en/learnin
g.quickstart.html
Components of Acl(ZF)
● Zend_Acl is a flexible implementation for privileges
management.
● Mainly two objects (Resource and role) are involved
→ a resource is an object to which access is
controlled.
→ a role is an object that may request access to a
Resource.
→ And privileges is what an object can do on the
Resource.
Resource in Zend_Acl
● In Zend, resource can be a “module” or “controller”
or “controller action” or any block of code.
● Zend_Acl provides Zend_Acl_Resource_Interface
as a resource to facilitate creating resource.
● Additionally, Zend_Acl_Resource is provided by
Zend_Acl as a basic resource implementation.
● $acl = new Zend_Acl();
● $acl->add(new Zend_Acl_Resource('Resource'));
Role in Zend_Acl
● In Zend, role is the user type say “admin” or “guest”
etc.
● Zend_Acl provides Zend_Acl_Role_Interface as a
basic role to facilitate creating role.
● Additionally, Zend_Acl_Role is provided by
Zend_Acl as a basic role implementation.
● $acl = new Zend_Acl();
● $acl->addRole(new Zend_Acl_Role('guest'))
Zend Role continue.....
● In Zend_Acl, a role may inherit from one or more
roles. This is to support inheritance of rules among
role.
● The following code defines three base roles -
"guest", "member", and "admin"
● $acl->addRole(new Zend_Acl_Role('guest'))
->addRole(new Zend_Acl_Role('member'))
->addRole(new Zend_Acl_Role('admin'));
Zend Role continue.....
Inheritance
● $acl->addRole(new Zend_Acl_Role('guest'), 'user')
Multiple Inheritance among Roles:
● $parents = array('guest', 'member', 'admin');
● $acl->addRole(new Zend_Acl_Role('someUser'),
$parents);
Zend Role continue.....
Multiple Inheritance among Roles:
● $acl->add(new
Zend_Acl_Resource('someResource'));
● $acl->deny('guest', 'someResource');
● $acl->allow('member', 'someResource');
● echo $acl->isAllowed('someUser',
'someResource') ? 'allowed' : 'denied';
Zend Role continue.....
Multiple Inheritance among Roles:
● O/P – allowed
● When specifying multiple parents for a role, then the
last parent listed is the first one searched for rules
applicable to an authorization query.
Creating a Simple ACL
Storing ACL Data
● Zend_Acl was designed in such a way that it does
not require any particular back-end technology such
as a database or cache server for storage of the ACL
data.
● Zend_Acl is serializable, ACL objects may be
serialized with PHP's serialize() function, and the
results may be stored anywhere the developer
should desire, such as a file, database, or caching
mechanism.
● Let us see an example to store the Acl data in
database.
Conditional ACL Rules
● Zend_Acl provides support for conditional rules
with Zend_Acl_Assert_Interface.
→ Only between the hours of 8:00am and 5:00pm.
→ Access / Deny specific to any IP address.
● $acl = new Zend_Acl();
● $acl->allow(null, null, null, new ClsAssertion());
→ Assertion only applies when the assertion method
returns TRUE
Benefits of using Acl
→ Security.
→ Filtering traffic.
→ Confidentiality - Control disclosure of
information.
→ Centralized place to access and manage ACL
rules, resources, and roles.
→ Maps nicely to the MVC controller/action
architecture.
→ Easiness of user and resource management.
→ Easy modification.
Questions??
Thank You
Voting time, please vote for better India :)

More Related Content

What's hot (20)

PPT
JSR 170: The Key to Unlocking Content Repositories
Joel Amoussou
 
PDF
AngularJS with Slim PHP Micro Framework
Backand Cohen
 
PDF
Caldera Learn - LoopConf WP API + Angular FTW Workshop
CalderaLearn
 
PPT
Zend Framework
Hao Chen 陈浩
 
PPTX
Code Igniter 2
Nitin Reddy Katkam
 
PPTX
Slim Framework
Pramod Raghav
 
PDF
Flask and Angular: An approach to build robust platforms
Ayush Sharma
 
ODP
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
vvaswani
 
ODP
Codegnitorppt
sreedath c g
 
PDF
Let ColdFusion ORM do the work for you!
Masha Edelen
 
PDF
Extending the WordPress REST API - Josh Pollock
Caldera Labs
 
PDF
Power of Simplicity in FW/1
Masha Edelen
 
PPTX
Extend sdk
Harsha Nagaraj
 
PDF
Introduction to plugin development
Caldera Labs
 
PPTX
AngularJS Directives
Eyal Vardi
 
PDF
AngularJS Basics with Example
Sergey Bolshchikov
 
PPTX
AngularJS $http Interceptors (Explanation and Examples)
Brian Swartzfager
 
PDF
Silex Cheat Sheet
Andréia Bohner
 
PPTX
AngularJS - $http & $resource Services
Eyal Vardi
 
PPT
SQL Injection in PHP
Dave Ross
 
JSR 170: The Key to Unlocking Content Repositories
Joel Amoussou
 
AngularJS with Slim PHP Micro Framework
Backand Cohen
 
Caldera Learn - LoopConf WP API + Angular FTW Workshop
CalderaLearn
 
Zend Framework
Hao Chen 陈浩
 
Code Igniter 2
Nitin Reddy Katkam
 
Slim Framework
Pramod Raghav
 
Flask and Angular: An approach to build robust platforms
Ayush Sharma
 
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswani
vvaswani
 
Codegnitorppt
sreedath c g
 
Let ColdFusion ORM do the work for you!
Masha Edelen
 
Extending the WordPress REST API - Josh Pollock
Caldera Labs
 
Power of Simplicity in FW/1
Masha Edelen
 
Extend sdk
Harsha Nagaraj
 
Introduction to plugin development
Caldera Labs
 
AngularJS Directives
Eyal Vardi
 
AngularJS Basics with Example
Sergey Bolshchikov
 
AngularJS $http Interceptors (Explanation and Examples)
Brian Swartzfager
 
Silex Cheat Sheet
Andréia Bohner
 
AngularJS - $http & $resource Services
Eyal Vardi
 
SQL Injection in PHP
Dave Ross
 

Similar to Zend ACL Basics (20)

PPTX
My first zf presentation part two
isaaczfoster
 
PPTX
Role Based ACL
Randy Carey
 
PDF
Instant ACLs with Zend Framework 2
Stefano Valle
 
PDF
Joomla! ACL - Joomla!Day Germany
Sander Potjer
 
PDF
Joomla 1.6 ACL - J and Beyond 2011 #jab11
Sander Potjer
 
PDF
Joomla ACL introduction, limit site access
Sander Potjer
 
PDF
Joomla Access Control List (ACL) at JoomlaDay London, UK #jduk11
Sander Potjer
 
PDF
Enrich your extensions with Joomla! ACL support
Sander Potjer
 
KEY
Fatc
Wade Arnold
 
PDF
Joomla! 1.6 ACL at #jd10uk
Sander Potjer
 
ODP
A Brief Introduction to Zend_Form
Jeremy Kendall
 
PPT
Top school in noida
Edhole.com
 
PDF
ACL in Joomla 1.6 at #jd11nl
Sander Potjer
 
PDF
Attribute-Based Access Control in Symfony
Adam Elsodaney
 
PDF
Practical Applications of Zend_Acl
Rowan Merewood
 
PPTX
Zend Framework Workshop
10n Software, LLC
 
PPT
green
alind tiwari
 
PPT
Greenathan
alind tiwari
 
My first zf presentation part two
isaaczfoster
 
Role Based ACL
Randy Carey
 
Instant ACLs with Zend Framework 2
Stefano Valle
 
Joomla! ACL - Joomla!Day Germany
Sander Potjer
 
Joomla 1.6 ACL - J and Beyond 2011 #jab11
Sander Potjer
 
Joomla ACL introduction, limit site access
Sander Potjer
 
Joomla Access Control List (ACL) at JoomlaDay London, UK #jduk11
Sander Potjer
 
Enrich your extensions with Joomla! ACL support
Sander Potjer
 
Joomla! 1.6 ACL at #jd10uk
Sander Potjer
 
A Brief Introduction to Zend_Form
Jeremy Kendall
 
Top school in noida
Edhole.com
 
ACL in Joomla 1.6 at #jd11nl
Sander Potjer
 
Attribute-Based Access Control in Symfony
Adam Elsodaney
 
Practical Applications of Zend_Acl
Rowan Merewood
 
Zend Framework Workshop
10n Software, LLC
 
Greenathan
alind tiwari
 
Ad

More from Mindfire Solutions (20)

PDF
Physician Search and Review
Mindfire Solutions
 
PDF
diet management app
Mindfire Solutions
 
PDF
Business Technology Solution
Mindfire Solutions
 
PDF
Remote Health Monitoring
Mindfire Solutions
 
PDF
Influencer Marketing Solution
Mindfire Solutions
 
PPT
High Availability of Azure Applications
Mindfire Solutions
 
PPTX
IOT Hands On
Mindfire Solutions
 
PPTX
Glimpse of Loops Vs Set
Mindfire Solutions
 
ODP
Oracle Sql Developer-Getting Started
Mindfire Solutions
 
PPT
Adaptive Layout In iOS 8
Mindfire Solutions
 
PPT
Introduction to Auto-layout : iOS/Mac
Mindfire Solutions
 
PPT
LINQPad - utility Tool
Mindfire Solutions
 
PPT
Get started with watch kit development
Mindfire Solutions
 
PPTX
Swift vs Objective-C
Mindfire Solutions
 
ODP
Material Design in Android
Mindfire Solutions
 
ODP
Introduction to OData
Mindfire Solutions
 
PPT
Ext js Part 2- MVC
Mindfire Solutions
 
PPT
ExtJs Basic Part-1
Mindfire Solutions
 
PPT
Spring Security Introduction
Mindfire Solutions
 
Physician Search and Review
Mindfire Solutions
 
diet management app
Mindfire Solutions
 
Business Technology Solution
Mindfire Solutions
 
Remote Health Monitoring
Mindfire Solutions
 
Influencer Marketing Solution
Mindfire Solutions
 
High Availability of Azure Applications
Mindfire Solutions
 
IOT Hands On
Mindfire Solutions
 
Glimpse of Loops Vs Set
Mindfire Solutions
 
Oracle Sql Developer-Getting Started
Mindfire Solutions
 
Adaptive Layout In iOS 8
Mindfire Solutions
 
Introduction to Auto-layout : iOS/Mac
Mindfire Solutions
 
LINQPad - utility Tool
Mindfire Solutions
 
Get started with watch kit development
Mindfire Solutions
 
Swift vs Objective-C
Mindfire Solutions
 
Material Design in Android
Mindfire Solutions
 
Introduction to OData
Mindfire Solutions
 
Ext js Part 2- MVC
Mindfire Solutions
 
ExtJs Basic Part-1
Mindfire Solutions
 
Spring Security Introduction
Mindfire Solutions
 
Ad

Recently uploaded (20)

PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Executive Business Intelligence Dashboards
vandeslie24
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Tally software_Introduction_Presentation
AditiBansal54083
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 

Zend ACL Basics

  • 2. Table of Contents ● What is Acl? ● Zend & Basic Set Up ● Components of Acl(Zend) ● Resources in Acl ● Roles in Acl ● Creating a simple Acl with example ● Storing ACL Data for Persistence ● Conditional ACL Rules with Assertions ● Benefits
  • 3. What is Acl? ● The functionality of specifying access rights to resources is access control. ● An ACL specifies which users or system processes are granted access to resources, as well as what operations are allowed on given resource. ● An access control list (ACL), with respect to a computer file system is a list of permissions attached to the files.
  • 4. Zend & Basic Set Up ● Zend Framework is an open source, object oriented web application framework for PHP 5. ● Zend is often called a 'component library', because it has many components that you can use more or less independently. ● Provides Model-View-Controller (MVC) implementation. ● Basic set up can be found here - http://framework.zend.com/manual/1.12/en/learnin g.quickstart.html
  • 5. Components of Acl(ZF) ● Zend_Acl is a flexible implementation for privileges management. ● Mainly two objects (Resource and role) are involved → a resource is an object to which access is controlled. → a role is an object that may request access to a Resource. → And privileges is what an object can do on the Resource.
  • 6. Resource in Zend_Acl ● In Zend, resource can be a “module” or “controller” or “controller action” or any block of code. ● Zend_Acl provides Zend_Acl_Resource_Interface as a resource to facilitate creating resource. ● Additionally, Zend_Acl_Resource is provided by Zend_Acl as a basic resource implementation. ● $acl = new Zend_Acl(); ● $acl->add(new Zend_Acl_Resource('Resource'));
  • 7. Role in Zend_Acl ● In Zend, role is the user type say “admin” or “guest” etc. ● Zend_Acl provides Zend_Acl_Role_Interface as a basic role to facilitate creating role. ● Additionally, Zend_Acl_Role is provided by Zend_Acl as a basic role implementation. ● $acl = new Zend_Acl(); ● $acl->addRole(new Zend_Acl_Role('guest'))
  • 8. Zend Role continue..... ● In Zend_Acl, a role may inherit from one or more roles. This is to support inheritance of rules among role. ● The following code defines three base roles - "guest", "member", and "admin" ● $acl->addRole(new Zend_Acl_Role('guest')) ->addRole(new Zend_Acl_Role('member')) ->addRole(new Zend_Acl_Role('admin'));
  • 9. Zend Role continue..... Inheritance ● $acl->addRole(new Zend_Acl_Role('guest'), 'user') Multiple Inheritance among Roles: ● $parents = array('guest', 'member', 'admin'); ● $acl->addRole(new Zend_Acl_Role('someUser'), $parents);
  • 10. Zend Role continue..... Multiple Inheritance among Roles: ● $acl->add(new Zend_Acl_Resource('someResource')); ● $acl->deny('guest', 'someResource'); ● $acl->allow('member', 'someResource'); ● echo $acl->isAllowed('someUser', 'someResource') ? 'allowed' : 'denied';
  • 11. Zend Role continue..... Multiple Inheritance among Roles: ● O/P – allowed ● When specifying multiple parents for a role, then the last parent listed is the first one searched for rules applicable to an authorization query.
  • 13. Storing ACL Data ● Zend_Acl was designed in such a way that it does not require any particular back-end technology such as a database or cache server for storage of the ACL data. ● Zend_Acl is serializable, ACL objects may be serialized with PHP's serialize() function, and the results may be stored anywhere the developer should desire, such as a file, database, or caching mechanism. ● Let us see an example to store the Acl data in database.
  • 14. Conditional ACL Rules ● Zend_Acl provides support for conditional rules with Zend_Acl_Assert_Interface. → Only between the hours of 8:00am and 5:00pm. → Access / Deny specific to any IP address. ● $acl = new Zend_Acl(); ● $acl->allow(null, null, null, new ClsAssertion()); → Assertion only applies when the assertion method returns TRUE
  • 15. Benefits of using Acl → Security. → Filtering traffic. → Confidentiality - Control disclosure of information. → Centralized place to access and manage ACL rules, resources, and roles. → Maps nicely to the MVC controller/action architecture. → Easiness of user and resource management. → Easy modification.
  • 17. Thank You Voting time, please vote for better India :)