ReactJS profiles - java

I am trying to understand if it is possible to use profiles like Java Spring profiles on ReactJS.
I mean, in case I developed a dashboard for many different customers, and want a core code for all of them, and by demand of one of the customers, add the part he wants only for him (only him will see this). Is it possible to achieve this on ReactJS?

Yes, it's possible to show users certain pages-components and allow them to navigate to certain routes.
You need authentication to distinguish between users with some roles "Backend server that generates the user's tokens and assign them roles or 3rd party service"
I suggest you using Redux with your react app, and once the user log-in you dispatch an action with the current user role
Once you dispatched the action all the components that connected to redux will be notified and your conditions that show/hide things will work properly

Related

Vaadin Applications Loading

We plan to write a Vaadin front-end which contains a couple of hundred Vaadin portlets which are associated to a menu, which in turn will dynamically select the functions that need to be presented to the user. The UI will feature a set of menu options for the user to select, and based upon user's command, it will load the appropriate portlet to an adjacent Vaadin panel. Even though the intention is to have something like this, the question is whether this application will pre-load all the functions during initialization and take a long time to load? Should we follow a particular design pattern to avoid such undesirable delay in loading the front-end?

User authorization in Java using Spring, Swing and SQLite

I am create Java Swing application using Spring. I am creating two user one admin second general. There are mainly five function or menu button in my application.
For admin user I want to show all five menu button, and for general user only four.
I have created logging window, getting username and password from SQLite.
I searched on the web and found Apache Shiro and JAAS. But I have to do this urgently, and to use that framework will need more time.
Is there any simple Java code to do this? Any example similar to my problem?
No need to look very far ,
you just need to query is it type 1 or type 2 user using simple table column mechnism and hide not necessary components

Implementing a readonly version of an application

Given an java web application that is currently running in a server, will deploying the same app (giving it a new context name ie. /app-readonly) but provide it with a readonly db account the only thing I need to make a readonly version of a web application.
I would expect that this readonly version of the application will be able to view, search but any updates/creates that are triggerred from the screen will just return an error (which is fine). This is the simplest solution I can think of, without introducing a code change in order to give finer grain control on the application's user access control. At the moment the user access control only dictates what screens are accessible to a user. It is not complex in that it does not dictate what the user can do in a given accessible page.
Is this a correct approach or am I missing something?
That approach is good only if you specifically want to deploy a new web application.
In my view you should create read only user and give that user access limited to Search, view.
In this case user wont have the rights to perform insert, update.
This approach should be there within your project, who can access what ? If you have to deploy a new app for view only, IMHO you need to revisit your access control design.

Multi Windowing on a Java Web project

I have an EJB 2.1 Project (Actually, it must be migrated into EJB 3.1 :-)) Currently it supports only one window. it means the user should work on a window. It is because of the variables, used as session variables. (Last Search Criteria, last used id, etc...).
I want to make it possible to open two or more tabs in for example Firefox and work parallel. If the user is on the same tab, the variables should be kept only for that tab. Only global variables can be valid for all tabs.
How can i approach to this problem.??
Any documentation to understand multiwindow will be also helpful.
Or any other idea or experiences about multiwindow web project is also welcome.
There isn't any built-in way to deal with this in either browsers or any EJB that I am aware of. Other web app frameworks have the concept of Web Flows that are series of connected actions that can handle multiple flows in different tabs of the same browsers, so you may wish to start looking there.
In a nutshell, they create their own "cookies" that the application controls, not the browser itself. These "application cookies" are then used to stash chunks of information related to the current set of operations, much like a session.
These sorts of things are often kicked off by the user clicking a link that opens in a "new window" (or tab) that notifies the application (via a page hit or an ajax call) that a new "work session" is being opened and gets the inner-session set up.

setup Login System and privilege and permission for Java

I'm trying to make a java program that prompt Login for the user and then some options and actions in the program will be available depend on the user permission. so for example , some user can print the picture other can not.
I'm sure this thing have been done many times. I'm looking for a tutorial or code sample to start with. I search in the interent but I couldn't find anything useful. Please help me
Thank you
and then some options and actions in the program will be available depend on the user permission
Design and build your GUI usings Actions. The Actions can be used to create your menu items and toolbar buttons.
Then, after the user is logged in you can disable the Action if the user doesn't have the permission to use that particular function.
Using this approach, the menu items and toolbar buttons will still appear in the UI, however they will be disabled so the user won't be able to use them.
You may want to look at Acegi http://www.acegisecurity.org/ , which is a java library that provides features for authorization.
Without Acegi Security (if you don't use it). First you must define all components from your application and save it to database. And then, create some tables such as role, user_role and role_components and components. Then when login, you must query this tables and check a security role from table role_components :)
CMIIW

Categories

Resources