<commit_before>/*
 * Copyright 2007 The Kuali Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.module.budget.document.authorization;

import org.kuali.core.document.authorization.DocumentAuthorizerBase;
import org.kuali.kfs.document.authorization.AccountingDocumentAuthorizerBase;

//public class BudgetConstructionDocumentAuthorizer extends AccountingDocumentAuthorizerBase {
public class BudgetConstructionDocumentAuthorizer extends DocumentAuthorizerBase {
    
}<commit_msg>overrode getEditMode() and getDocumentActionFlags()<commit_after>/*
 * Copyright 2007 The Kuali Foundation.
 * 
 * Licensed under the Educational Community License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.module.budget.document.authorization;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.kuali.Constants;
import org.kuali.core.authorization.AuthorizationConstants;
import org.kuali.core.bo.user.UniversalUser;
import org.kuali.core.document.Document;
import org.kuali.core.document.authorization.DocumentActionFlags;
import org.kuali.core.document.authorization.DocumentAuthorizerBase;
import org.kuali.core.exceptions.GroupNotFoundException;
import org.kuali.core.workflow.service.KualiWorkflowDocument;
import org.kuali.kfs.document.authorization.AccountingDocumentAuthorizerBase;
import org.kuali.rice.KNSServiceLocator;

import edu.iu.uis.eden.EdenConstants;
import edu.iu.uis.eden.clientapp.vo.ValidActionsVO;

//public class BudgetConstructionDocumentAuthorizer extends AccountingDocumentAuthorizerBase {
public class BudgetConstructionDocumentAuthorizer extends DocumentAuthorizerBase {
    private static Log LOG = LogFactory.getLog(BudgetConstructionDocumentAuthorizer.class);

    /**
     * This inits and returns an editModeMap based on the BC security model
     * 
     * @see org.kuali.core.document.authorization.DocumentAuthorizerBase#getEditMode(org.kuali.core.document.Document, org.kuali.core.bo.user.UniversalUser)
     */
    @Override
    public Map getEditMode(Document d, UniversalUser u) {

//        return super.getEditMode(d, u);

        /*
         * TODO eventually this needs to call service methods that implements the BC security model
         */ 
        Map editModeMap = new HashMap();
        String editMode = AuthorizationConstants.EditMode.FULL_ENTRY;
        editModeMap.put(editMode, "TRUE");

        return editModeMap;
    }

    /**
     * @see org.kuali.core.document.authorization.DocumentAuthorizerBase#getDocumentActionFlags(org.kuali.core.document.Document, org.kuali.core.bo.user.UniversalUser)
     */
    @Override
    public DocumentActionFlags getDocumentActionFlags(Document document, UniversalUser user) {
//TODO this needs to call service methods that implements the BC security model
//        return super.getDocumentActionFlags(document, user);
            LOG.debug("calling BudgetConstructionDocumentAuthorizer.getDocumentActionFlags for document '" + document.getDocumentNumber() + "'. user '" + user.getPersonUserIdentifier() + "'");

            DocumentActionFlags flags = new DocumentActionFlags(); // all flags default to false

            flags.setCanClose(true);
            flags.setCanSave(true);

            //TODO is this needed for BC??
            setAnnotateFlag(flags);

            return flags;
    }


}
{'fraction_non_alphanumeric': 0.0815634884771803, 'fraction_numerical': 0.0031631269769543608, 'mean_word_length': 4.159673659673659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '145623', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1161, 'n_words': 341}