os/persistentdata/persistentstorage/dbms/security/SC_PassAllPolicy.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// CPassAllPolicy class - "DBMS security" related code. Used in no_security environment or for
sl@0
    15
// non-secure databases
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
#include "SC_PassAllPolicy.h"
sl@0
    20
sl@0
    21
namespace DBSC
sl@0
    22
{
sl@0
    23
sl@0
    24
CPassAllPolicy::CPassAllPolicy(TPolicyObjType aPOType) :
sl@0
    25
	iPOType(aPOType)
sl@0
    26
	{
sl@0
    27
	}
sl@0
    28
sl@0
    29
CPassAllPolicy::~CPassAllPolicy()
sl@0
    30
	{
sl@0
    31
	}
sl@0
    32
sl@0
    33
//The method returns always ETrue.
sl@0
    34
TBool CPassAllPolicy::Check(const RMessage2&, TPolicyType) const
sl@0
    35
	{
sl@0
    36
	return ETrue;
sl@0
    37
	}
sl@0
    38
sl@0
    39
//The method initializes aPolicy parameter with "EAlwaysPass" type policy instance and
sl@0
    40
//returns KErrNone.
sl@0
    41
TInt CPassAllPolicy::Get(TPolicyType, TSecurityPolicy& aPolicy) const
sl@0
    42
	{
sl@0
    43
	__ASSERT(0);
sl@0
    44
	aPolicy = TSecurityPolicy(TSecurityPolicy::EAlwaysPass);
sl@0
    45
	return KErrNone;
sl@0
    46
	}
sl@0
    47
sl@0
    48
#ifdef __DBDUMP__
sl@0
    49
void CPassAllPolicy::Dump(RFile& aFile) const
sl@0
    50
	{
sl@0
    51
	_LIT8(KClassName, "Class: CPassAllPolicy. this=%X");
sl@0
    52
	TBuf8<40> buf;
sl@0
    53
	_LIT8(KCrLf, "\r\n");
sl@0
    54
	_LIT8(KObjType, "Object: ");
sl@0
    55
	_LIT8(KDatabase, "Database");
sl@0
    56
	_LIT8(KTable, "Table");
sl@0
    57
sl@0
    58
	buf.Format(KClassName, this);
sl@0
    59
	(void)aFile.Write(buf);
sl@0
    60
	(void)aFile.Write(KCrLf);
sl@0
    61
	(void)aFile.Write(KObjType);
sl@0
    62
	iPOType == EPOTDatabase ? (void)aFile.Write(KDatabase) : (void)aFile.Write(KTable);
sl@0
    63
	(void)aFile.Write(KCrLf);
sl@0
    64
	}
sl@0
    65
#endif
sl@0
    66
sl@0
    67
} //end of - namespace DBSC