# Getting redirected to admin dashboard and setting policy that only admin can controll the data on the table

**URL:** <https://discourse.cakephp.org/t/getting-redirected-to-admin-dashboard-and-setting-policy-that-only-admin-can-controll-the-data-on-the-table/11485>\
**Category:** Need Help\
**Created:** [September 1, 2023, 11:06am UTC](https://discourse.cakephp.org/t/getting-redirected-to-admin-dashboard-and-setting-policy-that-only-admin-can-controll-the-data-on-the-table/11485 "2023-09-01T11:06:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yousuo](https://avatars.discourse-cdn.com/v4/letter/y/898d66/32.png) [@yousuo](https://discourse.cakephp.org/u/yousuo)\
**Post date:** [September 1, 2023, 1:27pm UTC](https://discourse.cakephp.org/t/getting-redirected-to-admin-dashboard-and-setting-policy-that-only-admin-can-controll-the-data-on-the-table/11485/2 "2023-09-01T13:27:41Z")

</div>

You need user type segregation. With this, you can set super-admin, admin, manager, data-entry, view-only, etc types of user access (using `Policy` authorization to control everything).

Someone asked this previously and here is a way to do it so you will have full-control.

> [@Cakephp 4.4.15 User Permissions from database table dynamic way](https://discourse.cakephp.org/t/cakephp-4-4-15-user-permissions-from-database-table-dynamic-way/11401/2):
>
> I have done something similar without plugins. Here is what I did (which I think it has been discussed before, as this is a common feature) Create a database table called UserAccess, linked to Users. This will control which user has access to view, create, edit (in my example here, there is no delete feature as it is only kept for Admin) for each Kitchen-price, Kitchen-items, etc. Data is stored as (single digit) integer. I use unix access (e.g. 7 for full access). L…

---

_[View the full topic](https://discourse.cakephp.org/t/getting-redirected-to-admin-dashboard-and-setting-policy-that-only-admin-can-controll-the-data-on-the-table/11485)._
