Comments (3)
mainkan aja di menu
from yii2-mimin.
mainkan dimenu?
maksudnya bagaimana ya?
untuk menu yang setau saya dia bisa mengelompokan saja kan?
kepikiran begini sih cuma belum berhasil.
sekarang lagi coba bikin kustom AccessControl yang di extends dari AccessControl Mimin.
jadi kalo dicek di tabel auth_assignment si item_name == 'customer', mau di redirect ke halaman notfound. kustom access controlnya dibuat khusus dibackend aja. jadi setiap user yang akses backend dia musti lewati pengecekan dulu disini. kalo rolesnya dia customer dia gak boleh akses, dan dialihkan ke halaman page notfound. itu berlaku hanya untuk customer aja, jika nanti ada roles baru misal "staff" dia masih bisa masuk backend dan menunya difilter pake filterRouteMenu.
barbar banget ya caranya. hehe
sementara bikin custom class begini isinya :( nambahin 1 field di user
namespace backend\components;
use Yii;
use hscstudio\mimin\components\AccessControl;
class AccessControlCustom extends AccessControl{
public function __construct(){
$user = $this->getUser();
if($user->identity->user_type==2){ // 2= customer
header("Location: http://localhost/advanced/frontend/web/error");
die();
}
}
}
from yii2-mimin.
Gunakan filterRouteMenu sehingga menu yang akan muncul hanya untuk user spesifik
use hscstudio\mimin\components\Mimin;
// list semua menu baik untuk admin, staff, guest
$items = [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'Administrator', 'url' => ['/admin/index']],
['label' => 'Super Dewa', 'url' => ['/dewa/index']],
];
// filter
$items = Mimin::filterRouteMenu($items);
// setelah di filter gini, misal yang login guest ya cuman liat menu Home doang..
if(count($items)>0){
$menuItems[] = ['label' => 'Reporting', 'items' => $items];
}
from yii2-mimin.
Related Issues (20)
- setiap update user atau add user , status pasti menjadi banned HOT 1
- [Bug] Tampilan route di view role banyak yang double HOT 1
- Assign Role to user HOT 2
- Failed to update role on user
- Failed to update user password HOT 2
- Wrong behavior Mimin::checkRoute HOT 1
- Tidak bisa update password HOT 1
- tidak bisa generate route untuk frontend HOT 2
- Membuat dynamic menu tiga tingkat HOT 2
- Error saat menggunakan prefix table
- Navigasi tidak muncul setelah di filter Mimin::filterMenu
- tutorial integrasi yii2-mimin dengan ekstensi adminlte
- PHP 7.2 compability
- Unable to generate route for modules inside backend HOT 1
- Gagal Generate Route
- PHP Parse Error 'yii\base\ErrorException' with message 'syntax error, unexpected ','' HOT 1
- Could you add full i18n support? HOT 1
- Run migrate got errors. HOT 3
- View role permission are not same as supposed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-mimin.