Book Image

Web Application Development with Yii 2 and PHP

By : Mark Safronov, Jeffrey Winesett
Book Image

Web Application Development with Yii 2 and PHP

By: Mark Safronov, Jeffrey Winesett

Overview of this book

<p>Yii is a high performance PHP framework used for rapid web application development. It is well designed, well supported, easy to learn, and easy to maintain. This book embraces the learn-by-example methodology to show you the most important features of the Yii 2 framework. Throughout the course of this book, you will build a simple real-world application; each chapter will introduce you to a new functionality and show you how to tweak your application. Instead of trying to be an all-encompassing reference about the framework, this is a walkthrough of the really important pieces of information that you have to understand in detail.</p> <p>You will learn how to use Yii's active record and CRUD scaffolding to manage the data in your database. Authentication, extensions, events and behaviors, and route management are just some of the many other features of Yii that you will learn from this book. By the end of this book, you will have a basic CRM application that is all set for service!</p>
Table of Contents (22 chapters)
Web Application Development with Yii 2 and PHP
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Protecting the CRM management from CRM users


We have differentiated the CRM manager and CRM user roles since the very beginning in our specifications for the application. So far, each acceptance test began with some work on the side of database management and ended with either usage of public interface or checking some assumptions right in the management UI.

Now, it's time to really prohibit the CRM user from accessing the database management UI pages. We are going to implement the following business ruleset:

  • Unauthenticated (guest) users should not be able to access anything except the home page and the login form.

  • User-level users should be able to access the Query Customer By Phone UI.

  • Manager-level users should be able to access everything except the User Management UI.

  • Administrator-level users should be able to access everything.

Have a look at the following scheme:

We already have tests for the login and logout functionality without testing for access rights afterwards. However, now we...