mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 22:16:28 +00:00
Enforce assignment permissions and show active milestones
Gate assignment creation and editing by the relevant permissions, show ongoing milestones on the timeline, and restrict the forbidden-page admin link to authorized users. Also use the shared RBAC role type and tighten sidebar active-state matching.
This commit is contained in:
@@ -41,11 +41,7 @@ const SidebarItem: FC<Props> = ({ menu, expand, onChangeExpand }) => {
|
||||
}
|
||||
|
||||
const getActiveBackgroundMenu = () => {
|
||||
const currentPath = pathanme || '';
|
||||
const fullPath = '/admin' + (menu.path || '');
|
||||
const isActive = menu.path === '' ? currentPath === '/admin' || currentPath === '/admin/' : currentPath === fullPath || (menu.path && currentPath.startsWith(fullPath + '/'));
|
||||
|
||||
if (isActive) {
|
||||
if (pathanme === '/admin' + menu.path) {
|
||||
return {
|
||||
color: theme === 'dark' ? '#fff' : theme === 'system' && systemTheme === 'dark' ? '#fff' : '#fff',
|
||||
fontWeight: theme === 'light' ? 600 : theme === 'system' && systemTheme === 'light' ? 600 : undefined,
|
||||
|
||||
Reference in New Issue
Block a user