Skip to main content

How to disable the access control policy

How to disable the access control policy:

1. Open wc-server.xml which is located in WCDE_ENT70\workspace\WC\xml\config\wc-server.xml
2. Search for "<Instance" tag
3. Add AccessControlUnitTest="true immediately after "<Instance "
4. Save the file
5. Restart the server

After implementing this steps the server will not throw  "User does not have authority to execute Command/View"

How to disable access control check in Commands:


If you want to disable access control policy for a controller command then call setAccCheck(false) before calling execute.
This method is set by the web controller to indicate whether an access control check is required for this command.

For e.g
OrderCreateCmd orderCreateCmd=
(OrderCreateCmd ) CommandFactory.createCommand(OrderCreateCmd .NAME,   getStoreId())    
orderCreateCmd.setAccCheck(false);
orderCreateCmd.execute();

accessControlCheck():

This method performs a command level access control check for this command. The default implementation invokes the access control manager to perform the check.This method returns true
if the user has authority and false otherwise.


getResources()
This method is used to implement resource-level access control. It returns a vector of resource-action pairs upon which the command intends to act. If nothing is returned, no resource-level access control is performed.In order to Skip Resource level Access  control in a Controller Command do as below. But it is not recommended.
public AccessVector getResources() {
return null;
}

checkIsAllowed()

This method determines whether a user can perform a specified action on a certain resource. This method is called by the command to perform a resource level access control check in addition to the resources returned by the getResources() method.

Comments

Popular posts from this blog

How to read applied promotions codes

The below snippet will give you to read the promotions codes which are applied to order number, String orderId = "978593958"; OrderKey orderKey = new OrderKey(new Long(orderId)); PromotionArgumentSessionBeanPersistenceManager promoManager = new PromotionArgumentSessionBeanPersistenceManager(); PromotionArgument promArg = promoManager.load(orderKey); Iterator prmoExeRecds = promArg.getPromotionExecutionRecords(); while(prmoExeRecds.hasNext()) { PromotionExecutionRecord promotionExeecutionRecord = (PromotionExecutionRecord) prmoExeRecds.next(); Promotion promotion = promotionExeecutionRecord.getPromotion(); System.out.println("Name: " + promotion.getName()); System.out.println("Admin description: " + promotion.getDescription(commandContext.getLocale(), com.ibm.commerce.marketing.promotion.Description.SHOPPER_SHORT_DESC)); }

Dataload Utility

Data can be loaded into WCS tables using data load utility. WCS Data Load utility performs the following functions in a single operation: 1.                Reads the data from the input source file. 2.                Transforms the source data to Web Sphere Commerce business objects. 3.                Allocates and resolves Web Sphere Commerce business objects to physical data. 4.                Loads the physical data into the database. There are three configurations files and a input source file required to complete the data loader setup. WCS supports only CSV File Reader for other input source you have to write your own Reader Class. This means that if you are using OOB CSV Reader then your input file must be...

IBM Websphere Commerce V8.0

IBM Websphere Commerce V8.0 is Announced and its Here: Just in case if you have missed the announcement on Oct 1st, 2015 of IBM Websphere Commerce Version 8.0. Here is the  Link . IBM WebSphere Commerce-powered stores are going to get a lot of up-gradation. As IBM releases its  WebSphere Commerce V8.0 enhancements, Merchandisers can expect a richer, easier experience for users and marketers deepen customer engagement, drive customer loyalty, increase revenues, and improve profitability with an improved business user environment. Help deliver a better customer service and support experience. Provide a software platform upgrade to the latest web application server, database, and integrated developer environment, and incorporate earlier WebSphere Commerce V7.0 feature pack capabilities. Key things to know about IBM WebSphere Commerce V8.0: DHTML (Dynamic HTML) :   In Version 8.0, the Management Center is updated to use  Dynamic HTML (DHTML) . ...