您好,欢迎来到纷纭教育。
搜索
您的当前位置:首页创建profile

创建profile

来源:纷纭教育
Creating new Profiles

创建新的配置文件

This document explains, step by step, how to create your own iTop module in order to create new profiles to grant access to the iTop application. 本文档说明,一步一步,如何创建自己的ITOP模块,以创造新的配置文件来授予ITOP应用访问权限。

Goals of this tutorial本教程的目标

In this step-by-step tutorial you will learn to:

在这一步一步的教程你将学习:

•create your own extension module for iTop 2.0创建您自己的扩展模块iTop 2.0 • define new profiles for iTop定义新的配置文件ITOP

• on-board the new profiles by running the setup again 加载新的配置文件通过再次运行安装

For the purpose of this tutorial we will create two new profiles: 对于本教程,我们将创建两个新的配置文件

•A complete read-only profile, which grants the users the rights to browse through the

application, but not to change anything in iTop

一个完整的只读配置文件,授予了用户浏览应用程序权利,而不是在iTop改变任何东西

• A read-only profile similar to the “Portal user” profile which grants the users enough rights to

browse through the normal iTop application in read-only mode for most classes but also to use the Portal for submitting User Requests.

一个只读文件类似于―门户用户―文件授予了用户足够的权限来浏览应用程序的正常iTop在只读模式对于大多数类但也使用门户提交用户请求。

What you will need你需要什么

•iTop installed on a development machine, on which you can easily access/edit the files.

iTop安装在开发机器上,您可以很容易地访问/编辑文件。

• A text editor capable of editing PHP and XML file and supporting UTF-8. On Windows you can

useWordpad (Notepad does not like Unix line endings) or one of the excellent free development IDEs like PSPad or Notepad++.

一个文本编辑器能够编辑PHP和XML文件和支持utf – 8用写字板(记事本不喜欢Unix行结尾的),或者一个优秀的自由发展的IDE PSPad或记事本等。

Customization process定制过程

The customization process is the following: 定制过程如下:

1. Install a development instance of iTop. It is always better not to experiment in production !!

安装一个开发实例的iTop。它总是最好的在生产实验! ! 2. Install the toolkit to assist you in the customization

安装工具包来协助你定制

3. Create a new (empty) module using the module creation wizard

创建一个新的(空)模块使用模块创建向导

4.Copy this new module to the extensions folder on iTop and run the setup again to install the empty module

3.复制这个新的模块来扩展文件夹,运行安装iTop再次安装空模块

5.Modify the module in extensions and use the toolkit to check your customizations 5.修改模块的扩展和使用工具箱来检查你的定制 6. Run the setup again to create the new profile(s) 再次运行安装创建新的配置文件

Repeat the last two points until you are satisfied with your customization. When you are done, your new module is ready to be deployed. Copy the module folder in the extensions directory on your production iTop instance and run the setup to install it.

重复最后两个点直到您满意您的定制。当你完成了,你的新模块准备部署。复制模块文件夹在扩展目录在你的生产iTop实例并运行安装安装它。

Step by step tutorial一步一步的教程

Create your customization module

创建您的定制模块

Use the module creation wizard. Fill the form with the following values: 使用模块创建向导。填表用以下值:

Label标签 Module name 模块名 Value数值 Remarks备注 Names starting with itop- and combodo- are reserved for use by Combodo. It is recommended not to put spaces or accentuated characters in the name of the module. Two modules with the same name cannot co-exist in the same iTop instance. 名字从itop -和combodo——是留给combodo使用。建议不要将空格或加重了角色在该模块的名称。两个模块具有相同名称的不能共存在同一iTop实例。 sample-add-profile 样品- 添加–文件 Module Label 模块标签 Add Profile Sample Add Profile Sample This label will be displayed in the setup wizard. Localized characters and spaces are allowed 1.0.0 The convention is to use a 3 digits numbering scheme: X.Y.Z business Modules that provide modifications to the data model should be in the category 'business' Module Version Category business Dependencies itop-profiles-itil/1.0.0 Our customization module depends on the modules: iTop Profiles ITIL since we will be using the groups defined in this module. Note that this module retained the version 1.0.0 even in iTop2.0 !! Click

Generate !to download the empty module as a zip file.

Install the empty module

Expand the content of the zip into the extensions folder of your development iTop instance. You should now have a folder named sample-profile-class inside the extensions folder. this folder contains the following files:

•datamodel.sample-add-profile.xml • module.sample-add-profile.php • en.dict.sample-add-profile.php • model.sample-add-profile.php

Make sure that the file conf/production/config-itop.php is writable for the web server (on Windows: right click to display the file properties and uncheck the read-only flag; on Linux change the rights of the file), then launch the iTop installation by pointing your browser to http://your_itop/setup/

Click “Continue »” to start the re-installation.

Make

sure that “Update an existing instance” is selected before clicking “Next »”.

Continue to the next steps of the wizard…

Your custom module should appear in the list of “Extensions”. If this is not the case, check that the module files have been copied in the proper location and that the web server has enough rights to read them.

Select your custom module before clicking “Next »” and complete the installation.

Declare the new Profiles生明新的配置文件

Using you favorite text editor, open the file datamodel.sample-add-profile.xml.

Inside the user_rights tag, add the following piece of XML:

Read-Only Except Requests

Users with this profile are allowed to browse through all objects in the application and to create/modify user requests (either through the portal or in the normal application)

allow

allow

allow

allow

allow

Read-Only No Portal Access

Users with this profile are allowed to browse through all objects in the application but not to modify anything (event through the portal)

allow

allow

This instructs iTop to define two new profiles.

• The first profile (numbered id=“50”) is actually a clone of the “Portal User” profile. The only difference is that “Portal User” is a conventional name for a profile. Any user which has the “Portal User” profile is automatically directed to the portal interface of iTop. Since our new profile is named “Read-Only Except Requests”, users with this profile are allowed to navigate through the standard user interface of iTop.

• The second profile (numbered id=“51”) is a pure read-only profile: it allows only to browse through iTop but not to change anything.

The profiles are defined by accumulating rights on a given set of classes - listed in “groups”. By convention the group with id=“*” means “any class”. The other groups used in this example are the groups already defined in the module “itop-profiles-itil” (you can see their definition in the file datamodel.itop-profiles-itil.xml).

For example the group “Portal user - write” is defined as follows:

This group is used to grant rights on the classes: FileDoc (a file document), UserRequest (a user request ticket) and also lnkTicketToDoc (the n:n relation between a Document and a Ticket). In order to let the end-user create a User Request ticket (and attach/detach documents to the ticket), the profile “Read-Only Except Requests” must grant write access to all classes in this group (The read access is granted by the rule on the “*” group).

Refer to the XML reference documentation for more information about the XML syntax for groups and profiles.

Since we don't need to redefine any group of classes, the

datamodel.add-profile-sample.xml file should contain only the following:

datamodel.sample-add-profile.xml

Read-Only Except Requests

Users with this profile are allowed to browse through all objects in the application and to create/modify user requests (either through the portal or in the normal application)

allow

allow

allow

allow

allow

Read-Only No Portal Access

Users with this profile are allowed to browse through all objects in the application but not to modify anything (event through the portal)

allow

allow

Check your modification by running the toolkit. Point your browser to http://your_itop/toolkit.

If any error is reported at this stage, fix it by editing the XML file and check again your modifications by clicking on the “Refresh” button in the toolkit page.

On-board the new Profiles

When you are done with the modifications, you need to run the setup again in order to onboard the new profiles.

Make sure that the file conf/production/config-itop.php is writable for the web server (on Windows: right click to display the file properties and uncheck the read-only flag; on Linux change the rights of the file), then launch the iTop installation by pointing your browser to http://your_itop/setup/

Click “Continue »” to start the re-installation.

Make sure that “Update an existing instance” is selected before clicking “Next »”.

Continue to the next steps of the wizard…

Your custom module should appear in the list of “Extensions”, it should already be checked and greyed out (meaning that you cannot deinstall it). Just press “Next »” and complete the installation.

The profiles are defined in the XML but are actually stored in the database. The on-boarding operation that loads them into the database is currently performed only by the setup, so you need to run the setup again each time a new profile is defined (or if a profile definition is modified).

Final Customization Module

You can download the complete customization module by clicking on the link below:

sample-add-profile.zip

Next Steps

To deploy your customization to another iTop server, simply copy the folder “sample-add-profile” to the extensions folder of iTop and run the setup again.

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- fenyunshixun.cn 版权所有 湘ICP备2023022495号-9

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务