Multiple logins in cakephp - cakephp-1.2

In my current project in cakephp, there are different roles for different users like admin, developer, researcher and customers. Obviously, their views are also different depending on their usergroup..
But now my admin wants to be able to see the views for every usergroup in his browser. He has asked me to add two buttons on his home page for customer view and researcher view. Is this possible to achieve? And if yes, how ?

Simply override the role in the Auth session and reload the page? Here is a simple example.
public function toggle_user($role = 'reviewer') {
$this->Session->write('Auth.User.role', $role);
$this->redirect($this->referer());
}
Change it depending on how your app is built.

Related

How to change the Read Access to the users on custom Visualforce page in Salesforce

The question is about the custom visualforce page in Salesforce. The page is created for getting contacts, opportunity, loans all are at a single dynamic link on the account named "Manage portal Access" Which comes under "Customer Portal Access" Tab like details and related list under "Account" Tab.The page was created to Manage the customer account, contacts and opportunities relationship. The page contains Email, Role, Last Login and a Toggle button as "Enabled".When this toggle button is enabled, those users have access to this portal relationship. It has respective apex class also.
The task here is, the toggle button can be enabled/disabled by some users, this want to be changed here by providing Read only access and assign two permission sets for edit access on this portal enable/disable.
" As a user I want Read Only Access to the portal tab. I want to be able to view all information on the tan and click through any dynamic links, but not be able to toggle the portal enable or un-portal enable any contacts. All Salesforce users should have a minimum of read only access to the Customer Portal Access Tab. The two permission below currently and should continue to provide edit access to the customer portal access section.
Create Customer Portal User
Document Manage Portal Admin "
Whether there is any customization option like providing access to objects in Salesforce through (Layouts, Fields FLS, Validation Rule)?
Or
-This can be achieved only through code on Visual force page and it's respective apex class, if this is the case how can I do it, whether there is any certain command or method for providing access or through controller class?
The "normal" object permissions (Create/Read/Update/Delete) and field level security (Read/Update) can be referenced in Visualforce. Something like this might be enough for you:
<apex:commandButton disabled="{!$ObjectType.Contact.fields.Role__c.updateable}">
Check the DescribeFieldResult in Apex reference. There's also something mentioned in VF developer guide but it's bit hidden and not as detailed: https://developer.salesforce.com/docs/atlas.en-us.234.0.pages.meta/pages/pages_variables_global_objecttype.htm
If you need more control than just whether field is editable or not - maybe look into Custom Permissions. They're your own checkboxes you add to Profile/Permission Set and you can check them in pure VF too, no apex required.
So... you decide. If most of the page is supposed to be identical, "just" about the button being enabled/disabled (or maybe even not rendered at all) - it's best to put the condition in the button. If it sounds like you need 2 different layouts - having 2 big blocks of code and one or another rendered might be cleaner to maintain and test.
P.S. Remember that good tester can activate the button using browser's developer tools. You should make similar "is field accessible / is custom permission assigned" check in Apex that runs on button click.

Restrict Drupal view access by role

I would expect this would be easy but I can't seem to figure it out. Simple problem. I want to restrict access to a Drupal view as follows:
Only current users who are members of a custom role may access the view
OR
The view only displays content that is authored by the current user
The latter is easy, but restricting via current role is more problematic. Thoughts?
When you're looking at the Views admin screen (admin/structure/views/view/YOUR-VIEW/edit), look in the middle column and you should see an 'Access' option under the Page Settings heading. I believe by default it's set to Permission | Views Published Content; however, if you click Permission, you can then change this to Role, and select the desired role(s) that should be able to view this content. Hope that makes sense!

Role management in Angularjs for showing and hide tabs

We are using AngularJs , In our application we have around 8 roles like SUPER_ANDMIN, ADMIN,USER,RESELLER etc ,
so if user role is ADMIN , then 7 tabs show but if user role is USER , then only three tabs show , on every call we send role of user from server site.
so what is the best practice of it does we need to put ng-if on every tab or any better option in AngularJS
Thanks
You can either make a hybrid application creating multiple SPA's that define certain portions of functionality within your application or you can have one SPA with multiple views and restricting views based on your role.
In case of the latter you can use ui-router with data attached per view. Upon authentication you can determine the role and restrict the user from viewing certain pages.
I have a small example on plunker. Note that I haven't restricted the navigation in order for you to see that viewing the corresponding pages is prohibited nor is the authentication in any way a real implementation.

How to create separate admin panel for customer in joomla 3?

I am working on a project where my client has no idea about joomla admin panel.
So I have decided to provide a separate admin pannel which my client can access and manage few things.
I am also having multiple pages and sub-pages in this admin panel.
Lets say I want to give multiple manage links.
manage item
sub-menu
manage item 2
I am little confuse how do I do it, once I thought about component and moduel but I don't know how to add menu links in components for front end.
I am using joomla 3.0.
Many thanks in advance.
If your intention is creating a backend alternative to joomla to control joomla's frontend, this is a hard thing to do if you are just a e-commerce website developer.
But if you need a different account other than your administrator account, you can add one account and edit it's privileges.
A second admin panel for easier use? sorry that sounds not good. Just do it like serhat above said. make a new account for joomla admin-panel. cut of the privileges so the user see only the things he has access to! its better then coding a fully new admin panel. there is already a fully configurable panel so why do another one?
Give the users just what they have to see and hide the rest (via admin-privileges)

Configuring a portlet has three different names

When i include a portlet in a page, i'm asked to customize the portlet.
Trying to do so, i have three options namely:
Edit Shared settings
Personalize &
Configure
What does each mean and How do they differ?
This is an old page but it still describes the differences correctly: http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/topic/com.ibm.wp.ent.doc/wps/adcfgplt.html
In short:
Configure: Changes made here affect all occurrences of the portlet on all pages for all users. The administration portlets allow you to create multiple copies of the same portlet with different administrator level configurations.
Edit Shared: Changes made here affect a particular instance of a portlet on a page and apply to all users who view that instance of the portlet on that page.
Personalize: Changes made here are associated with a single user and apply only to that particular user who views the portlet on the page. Only that user can make that update.

Resources