Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: deltempl.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _DELTEMPL_H__
  11. #define _DELTEMPL_H__
  12. #include "util.h"
  13. #include "tempcore.h"
  14. ///////////////////////////////////////////////////////////////////////
  15. // CTemplateAccessPermissionsHolder
  16. class CTemplateClassReferences; // fwd decl
  17. class CTemplateAccessPermissionsHolder : public CAccessPermissionsHolderBase
  18. {
  19. public:
  20. CTemplateAccessPermissionsHolder(CSchemaClassInfo* pClassInfo, BOOL bScopeClass);
  21. virtual ~CTemplateAccessPermissionsHolder();
  22. HRESULT GetAccessPermissions(CAdsiObject* pADSIObj);
  23. BOOL SetupFromClassReferences(CTemplateObjectTypeListRef* pRefList);
  24. DWORD UpdateAccessList(CPrincipal* pPrincipal,
  25. LPCWSTR lpszServerName,
  26. LPCWSTR lpszPhysicalSchemaNamingContext,
  27. PACL *ppAcl);
  28. protected:
  29. virtual HRESULT _LoadAccessRightInfoArrayFromTable( BOOL bIgnore, BOOL bHideListObject);
  30. private:
  31. BOOL _SetControlRight(LPCWSTR lpszControlRight);
  32. BOOL _SetAccessMask(LPCWSTR lpszName, ULONG fAccessMask);
  33. BOOL _SetGeneralRighs(ULONG fAccessMask);
  34. BOOL _SetPropertyRight(LPCWSTR lpszName, ULONG fAccessMask);
  35. BOOL _SetSubObjectRight(LPCWSTR lpszName, ULONG fAccessMask);
  36. private:
  37. CSchemaClassInfo* m_pClassInfo;
  38. BOOL m_bScopeClass;
  39. };
  40. typedef CGrowableArr<CTemplateAccessPermissionsHolder> CTemplatePermissionHolderArray;
  41. ///////////////////////////////////////////////////////////////////////
  42. // CTemplateAccessPermissionsHolderManager
  43. class CTemplateAccessPermissionsHolderManager
  44. {
  45. public:
  46. CTemplateAccessPermissionsHolderManager()
  47. {
  48. }
  49. BOOL LoadTemplates(); // load template manager from INF file
  50. BOOL HasTemplates(LPCWSTR lpszClass); // tell if there are loaded templates for a class
  51. BOOL HasSelectedTemplates(); // tell if there is a selection
  52. void DeselectAll();
  53. BOOL InitPermissionHoldersFromSelectedTemplates(CGrowableArr<CSchemaClassInfo>* pSchemaClassesInfoArray,
  54. CAdsiObject* pADSIObj);
  55. DWORD UpdateAccessList(CPrincipal* pPrincipal,
  56. LPCWSTR lpszServerName,
  57. LPCWSTR lpszPhysicalSchemaNamingContext,
  58. PACL *ppAcl);
  59. // UI related operations
  60. BOOL FillTemplatesListView(CCheckListViewHelper* pListViewHelper, LPCWSTR lpszClass);
  61. void WriteSummary(CWString& szSummary, LPCWSTR lpszIdent, LPCWSTR lpszNewLine);
  62. protected:
  63. CTemplatePermissionHolderArray m_permissionHolderArray;
  64. CTemplateManager m_templateManager;
  65. };
  66. #endif // _DELTEMPL_H__