change response file & request get user-profile & change design dashboard page & handle limit page dashboard
This commit is contained in:
+4
-6
@@ -3,13 +3,11 @@ import { AbilityBuilder, createMongoAbility } from "@casl/ability";
|
||||
export function defineAbilitiesFor(user) {
|
||||
const { can, cannot, build } = new AbilityBuilder(createMongoAbility);
|
||||
|
||||
if (user?.role === "admin") {
|
||||
if (user) {
|
||||
can("access", "Dashboard");
|
||||
} else if (user?.role === "manager") {
|
||||
can("access", "Dashboard");
|
||||
} else {
|
||||
can("access", "Dashboard");
|
||||
// cannot("access", "Dashboard");
|
||||
} else {
|
||||
// can("access", "Dashboard");
|
||||
cannot("access", "Dashboard");
|
||||
}
|
||||
|
||||
return build();
|
||||
|
||||
Reference in New Issue
Block a user