How to change dashboard as per roles to employees in yii2? - yii2-basic-app

I am using yii2 basic and Admin LTE
I have Employee table and I have assigned Employee model to user application component and implemented RBAC.
I have Dashboard Controller and view.
1. Now when admin logs in, and clicks on Dashboard menu, he can see 4 info boxes showing statistics as follows:
Total no of employees
Total SHG Groups
Total Churches
Total Courses
2. Now when fieldofficer logs in, and clicks on Dashboard, he can also view the same statistics.
fieldofficer creates, views, updates and deletes only his own created SHGGroups.
So fieldofficer on his dashboard should be able to see only one info box showing total no of SHGGroups he own/creates
How to accomplish this?

Related

How to model users in the system?

I am working on system that will manage orders. Orders can be created via admin or via customer. Employee can take orders and change it's status.
My system should have three global types of users:
Admin - this type of users mostly uses WEB interface. Admins have different access levels, so some of them can only create orders, and others - edit core info about pricing and so on.
Customer - this type of users uses customer's mobile app. Main action is to add and cancel orders.
Employee - this type of users uses employee's mobile app. Employees can see open orders, assign themselves to orders and change order statuses.
Also, Customer and Employee can be authorised with phone number, that can be changed at some time (independently of each other). Admins can be authorised with uname + pword.
Current solution has one table for Admins, one for Customers and one for Employees.
So first part of question is how to structure database properly?
The second part is about authorising in REST api. In current solution I have three endpoints, that are authireses usertype independently.
admins/auth
customers/auth
employees/auth
And my thoughts is to keep three tables as is, because each usertype is slightly different concept and really independent. And keep authorisation as is, but add something like roles and privileges to auth token to restrict access for some resources.

Tracking statistics for frontend user login in TYPO3 8

I would like to generate statistics for a site, specifically which frontend user is logged in at specific times of the day, how many users are/were logged in, etc.
I have searched but couldn't find any extension that already does this. Does anyone know of either a TYPO3 extension or an external tool that already does this? Will Piwik track the information I am looking for?
We have a compatible extension for tracking FE-User.
Features:
Configure who should be tracked (configurable in Extensionmanager):
only non logged in visitors
only logged in Frontend-User
logged in and non logged in Frontend-User
Configure if the user data of logged in user should be tracked (configurable in Extensionmanager). If you don't track that user data, the tracking records behave like non logged in user.
Optionally track IP-Address (configurable in Extensionmanager)
Backend-Modul with:
Overview about all trackings
Listing by page
Listing by user
Listing by object (downloads, news, shop products, portfolios and more)
CSV export for tracking records
User restriction: Admin user see the whole tracking data. Editor user only the data from current selected page.
Tracking for pages and objects like:
Displaying News (EXT:news)
Downloading Files (EXT:downloadmanager with type restricted)
Products (EXT:shop)
Configure your own object by TypoScript
If it's interesting for you, get in contact with us.

Polls display according to Role selected in liferay

In liferay, the question selected by Admin in the Polls Display Portlet is displayed to the users. Now what I want to do is, display different question the users with different site Roles. Eg., role1 is assigned to userGroup1 and role2 is assigned to userGroup2 in the same site. Now when I add Polls Display Portlet on a page in Site, question1 has to be selected for userGroup1 and question2 for userGroup2. But now only one question can be selected and if permission is given the question is displayed else error tag "User does not have Permission" is displayed. So how can I achieve the functionality that role wise poll is displayed to the users?
You can put 2 PollS portlet on the page and give view permissions to one for role 1 and then role 2 to the other Polls portlet.
This way the portlet will alternate depending on the rights.
If you getting the do not have permissions message and don't want it. Look into portlet.preferences. You can disable it.

VSTS: Query based on observing user

I am working on some simple queries for Visual Studio Team Services. Is there a way to change the query result based on which user views it?
I know about the #Me operator but for this specific case I want to look for unassigned work items and filter them by current user.
There are 3 backlogs, and user A,B and C. User A is responsible to assign tasks for backlog1, user B for backlog2. I want to have a single dashboard with a query showing the unassigned task. So if user A opens the dashboard it should show all unassigned tasks for backlog1 and for user B all tasks from backlog2.
Microsoft has recently added the #Me token to all fields related to users.
This enables creating queries for the observing user - and in extension - personalised queries on the dashboard.
Additional info and the related docs can be found here

Liferay- landing to different communities based on their user-groups

My requirement is that i have a liferay portal which has two types of user creation process:
Manual creation by the admin
Users can create via create account
I want to land the users to different landing pages based on the user-groups. User creation process1 belongs to one group and process2 belongs to another group. How to achieve it. Process1 is working fine by setting the default landing path but i want to land the users who are created by process2 to a different landing page.
Thanks in advance!!
Regards,
S.Ponraj
Take a look at the page here for information on how to create a landing page hook.
You will also need a way to identify if the user is from process 1 or process 2. One possible approach would be using liferay custom fields (expando).