Skip to content

Commit

Permalink
Based edit bookmarks on "manageBookmarks"
Browse files Browse the repository at this point in the history
- Do not warning user if it's insufficient access in case of genesis applications (reference #65)
  • Loading branch information
piotrzarzycki21 committed Nov 19, 2024
1 parent be84e02 commit 6425f8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ package controller.roles.executeRoles
if (bookmarksMediator.view.currentState == MediatorBookmarks.BOOKMARKS_VIEW_STATE)
{
var loginProxy:ProxyLogin = facade.retrieveProxy(ProxyLogin.NAME) as ProxyLogin;
var hasAdminRole:Boolean = loginProxy.user && loginProxy.user.hasRole(Roles.ADMINISTRATOR);


var bookmarkCount:int = bookmarksMediator.view.bookmarksList.numElements;
for (var i:int = 0; i < bookmarkCount; i++)
{
var bookmark:Bookmark = bookmarksMediator.view.bookmarksList.getElementAt(i) as Bookmark;
if (bookmark)
{
bookmark.editable = hasAdminRole && loginProxy.user.display.manageBookmarks;
bookmark.editable = loginProxy.user.display.manageBookmarks;
}
}

bookmarksMediator.view.addBookmark["visible"] = hasAdminRole && loginProxy.user.display.manageBookmarks;
bookmarksMediator.view.addBookmark["visible"] = loginProxy.user.display.manageBookmarks;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package model.proxy

private const SESSION_UNAUTHENTICATED: String = "session-not-authenticated";
private const SESSION_AUTHENTICATED: String = "authenticated";
private const SESSION_AUTHLIMITEDACCESS: String = "authenticated-with-insufficient-access";
public const SESSION_AUTHLIMITEDACCESS: String = "authenticated-with-insufficient-access";

private var loginProxy:ProxyLogin;
private var sessionDelegate:SessionCheckDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package model.proxy.applicationsCatalog
import org.puremvc.as3.multicore.patterns.proxy.Proxy;

import services.GenesisAppsDelegate;
import model.vo.UserVO;

public class ProxyGenesisApps extends Proxy implements IDisposable
{
Expand Down Expand Up @@ -105,7 +106,8 @@ package model.proxy.applicationsCatalog
if (fetchedData)
{
var jsonData:Object = JSON.parse(fetchedData);
if (!sessionCheckProxy.checkUserSession(jsonData))

if (jsonData.status != sessionCheckProxy.SESSION_AUTHLIMITEDACCESS && !sessionCheckProxy.checkUserSession(jsonData))
{
return;
}
Expand Down

0 comments on commit 6425f8c

Please sign in to comment.