change response file & request get user-profile & change design dashboard page & handle limit page dashboard

This commit is contained in:
Ehsan
2025-05-31 03:35:23 +03:30
parent 0969eca274
commit 80c74361eb
38 changed files with 233 additions and 121 deletions
+4 -6
View File
@@ -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();