CN117195181A - Control authority control method and device, computer equipment and storage medium - Google Patents
Control authority control method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN117195181A CN117195181A CN202311183123.9A CN202311183123A CN117195181A CN 117195181 A CN117195181 A CN 117195181A CN 202311183123 A CN202311183123 A CN 202311183123A CN 117195181 A CN117195181 A CN 117195181A
- Authority
- CN
- China
- Prior art keywords
- target
- control
- service
- user
- authority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 230000015654 memory Effects 0.000 claims abstract description 34
- 230000006870 function Effects 0.000 claims description 16
- 230000008859 change Effects 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Landscapes
- Storage Device Security (AREA)
Abstract
The invention relates to the technical field of graphical user interfaces, and discloses a control method and device for control authority, computer equipment and a storage medium. Wherein the method comprises the following steps: acquiring first authority information, second authority information and a target service page, wherein the target service page comprises at least one data line; analyzing the target business page to obtain the user identity of the current user and a target control in the target business page; if the selected target data line exists in the target service page based on the message component, acquiring the current service operation type; and based on the user identity of the current user and the current business operation type, matching is carried out in the first authority information and the second authority information, and the target control is determined to correspond to the target use authority of the target data row. According to the scheme of the embodiment of the invention, the use of the memory of the client can be reduced, and the control efficiency of the control authority can be improved.
Description
Technical Field
The invention relates to the technical field of graphical user interfaces, in particular to a control method and device for control authority, computer equipment and storage media.
Background
In the related art, for control of control permission in a service page, a data line bound by a control generally acquires a large amount of subscription data in a broadcast manner, and the large amount of subscription data is cached in a client, and then is queried from the large amount of subscription data, so that the control permission control method not only causes a large amount of client memory to be occupied, but also reduces control efficiency of the control permission.
Disclosure of Invention
In view of this, the invention provides a control method and device, computer equipment and storage medium for control authority, which can not only reduce the use of the memory of the client, but also improve the control efficiency of the control authority.
In a first aspect, the present invention provides a control method for controlling rights of a control, where the method includes:
acquiring first authority information and second authority information, wherein the first authority information is used for indicating the corresponding relation between a user identity and a user role, the second authority information is used for indicating the corresponding relation between service information and the use authority of a control in a service page, and the service information comprises the user role, a service operation type and a service use state of the control;
Acquiring a target service page, wherein the target service page comprises at least one data line;
analyzing the target business page to obtain the user identity of the current user and a target control in the target business page;
if the selected target data line exists in the target service page based on the message component, acquiring the current service operation type;
and based on the user identity of the current user and the current business operation type, matching is carried out in the first authority information and the second authority information, and the target control is determined to correspond to the target use authority of the target data row.
According to the control method for the control permission provided by the embodiment of the invention, the message component is arranged, after the first permission information, the second permission information and the target service page are acquired, the message component is utilized to capture the selected target data row in the target service page, then the current service operation type is acquired, the matching is carried out between the first permission information and the second permission information based on the user identity of the current user and the current service operation type, the target control is determined to correspond to the target use permission of the target data row, a large amount of subscription data is not required to be cached, and the data row is searched from a large amount of subscription data, so that the use of a client memory is reduced, and meanwhile, the control efficiency of the control permission is improved.
In some optional embodiments, the matching between the first authority information and the second authority information based on the user identity of the current user and the current service operation type, determining the target usage authority of the target control corresponding to the target data line includes:
matching the user identity of the current user with the first authority information;
if the user identity of the current user is matched with the first authority information, obtaining a target user role of the current user;
and matching the current business operation type and the target user role with the second authority information, and determining the target use authority of the target control corresponding to the target data line.
According to the control authority control method provided by the embodiment of the invention, the user identity of the current user is matched with the first authority information, so that the target user role of the current user can be obtained when the user identity of the current user is matched with the first authority information, and then the target use authority of the target control corresponding to the target data row can be determined by matching the current business operation type and the target user role with the second authority information, thereby realizing control of the control-level authority and not conflicting with menu-level authority control. The control authority control can be not influenced by module codes, has low coupling, is easy to transplant and use in various angularjs systems, and has better universality.
In some optional embodiments, the business operation type in the second permission information includes a first business operation type, the matching the current business operation type and the target user role with the second permission information, and determining the target usage permission of the target control corresponding to the target data line includes:
if the target user role is matched with the user role in the second authority information, and the target user role is a preset user role, and the current service operation type is matched with the first service operation type, determining the service use state corresponding to the target control in the second authority information;
and if the service use state corresponding to the target control is an available state, determining that the target use permission of the target control corresponding to the target data row is an available permission.
According to the control method for the control permission provided by the embodiment of the invention, under the condition that the target user role is matched with the user role in the second permission information, the target user role is the preset user role, the current service operation type is matched with the first service operation type, the service use state corresponding to the target control in the second permission information can be determined, the service use state corresponding to the target control is judged to determine the target use permission of the target control corresponding to the target data row, and if the service use state corresponding to the target control is the available state, the target use permission of the target control corresponding to the target data row is determined to be the available permission, so that control of the control level permission is realized.
In some alternative embodiments, the method further comprises:
and if the target user role is not matched with the preset user role and the service use state is an available state, determining that the target use permission of the target control corresponding to the target data row is an available permission.
According to the control authority control method provided by the embodiment of the invention, under the condition that the target user role is not matched with the preset user role, if the service use state is the available state, the target authority of the target control corresponding to the target data row is the available authority.
In some alternative embodiments, when the target data line in the message component changes, the method further comprises:
analyzing the authority configuration parameters corresponding to the target control to obtain dynamic state parameters, wherein the dynamic state parameters are used for indicating the change of the target data row;
the service use state of the target control is redetermined according to the dynamic state parameters;
and updating the target use permission of the target control corresponding to the target data row according to the service use state.
According to the control method for the control permission provided by the embodiment of the invention, under the condition that the target data line in the message component changes, the dynamic state parameter can be obtained by analyzing the permission configuration parameter corresponding to the target control, and at the moment, the dynamic state parameter can influence the service use state of the target control, so that the service use state of the target control can be redetermined according to the dynamic state parameter, and finally, the target use permission of the target control corresponding to the target data line can be updated according to the service use state.
In some alternative embodiments, the method further comprises:
and if the selected target data row does not exist in the target business page based on the message component, determining the initial use permission of the target control based on the user identity of the current user, the first permission information and the second permission information.
In some optional embodiments, the determining the initial usage right of the target control based on the user identity of the current user, the first right information, and the second right information includes:
matching the user identity of the current user with the first authority information;
if the user identity of the current user is matched with the first authority information, obtaining a target user role of the current user;
and matching the target user role with the second authority information, and determining the initial use authority of the target control.
In some optional embodiments, the determining the service usage state corresponding to the target control in the second permission information includes:
and determining the service usage state corresponding to the target control in the second authority information based on a function let of crushstatus=ref (value: "pool|edit|+" (pool select window. Value. Status= =4) + "|crushstatus|").
In a second aspect, the present invention provides a control device for controlling rights of a control, including:
the system comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring first authority information and second authority information, the first authority information is used for indicating the corresponding relation between a user identity and a user role, the second authority information is used for indicating the corresponding relation between service information and the use authority of a control in a service page, and the service information comprises the user role, a service operation type and a service use state of the control;
the second acquisition module is used for acquiring a target service page, wherein the target service page comprises at least one data line;
the analysis module is used for analyzing the target service page to obtain the user identity of the current user and the target control in the target service page;
the third acquisition module is used for acquiring the current service operation type if the selected target data line exists in the target service page based on the message component;
and the first use permission determining module is used for matching the first permission information and the second permission information based on the user identity of the current user and the current business operation type, and determining the target use permission of the target control corresponding to the target data row.
In some optional embodiments, the first usage right determining module specifically includes:
the first matching sub-module is used for matching the user identity of the current user with the first authority information;
a first user role determination submodule, configured to obtain a target user role of the current user if the user identity of the current user is matched with the first authority information;
and the first usage right determining submodule is used for matching the current business operation type and the target user role with the second right information and determining the target usage right of the target control corresponding to the target data row.
In some optional embodiments, the business operation type in the second authority information includes a first business operation type, and the usage authority determining submodule specifically includes:
a service usage state determining unit, configured to determine, if the target user role is matched with the user role in the second permission information, and the target user role is a preset user role, and the current service operation type is matched with the first service operation type, the service usage state corresponding to the target control in the second permission information;
And the use permission determining unit is used for determining that the target use permission of the target control corresponding to the target data row is the available permission if the service use state corresponding to the target control is the available state.
In some optional embodiments, the control device of the control authority further includes:
and the second usage right determining module is used for determining that the target usage right of the target control corresponding to the target data row is the available right if the target user role is not matched with the preset user role and the service usage state is the available state.
In some optional embodiments, when the target data line in the message component changes, the control device of the control authority further includes:
the dynamic state parameter determining module is used for analyzing the authority configuration parameters corresponding to the target control to obtain dynamic state parameters, wherein the dynamic state parameters are used for indicating the change of the target data row;
the service use state determining module is used for redetermining the service use state of the target control according to the dynamic state parameters;
and the updating module is used for updating the target use permission of the target control corresponding to the target data row according to the service use state.
In some optional embodiments, the control device of the control authority further includes:
and the third usage right determining module is used for determining the initial usage right of the target control based on the user identity of the current user, the first right information and the second right information if the selected target data row does not exist in the target service page based on the message component.
In some optional embodiments, the third usage right determining module specifically includes:
the second matching sub-module is used for matching the user identity of the current user with the first authority information;
the second user role determination submodule is used for obtaining the target user role of the current user if the user identity of the current user is matched with the first authority information;
and the second use permission determination submodule is used for matching the target user role with the second permission information and determining the initial use permission of the target control.
In some alternative embodiments, the service usage status determining unit specifically includes:
and a service usage state determining subunit, configured to determine the service usage state corresponding to the target control in the second permission information based on a function let of crushstatus=ref (value: "pool|edit| +" (pool select window. Value. Status= =4) + "|crushstatus|").
In a third aspect, the present application provides a computer device comprising: the memory and the processor are in communication connection, computer instructions are stored in the memory, and the processor executes the computer instructions, so that the control method of the control authority of the first aspect or any corresponding embodiment of the first aspect is executed.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the control method of the control authority of the first aspect or any one of the embodiments corresponding thereto.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a control system for selectable control rights provided by an embodiment of the present application;
FIG. 2 is a flow chart of a control method for controlling rights of a control according to an embodiment of the application;
FIG. 3 is a schematic diagram of a target business page according to an embodiment of the present application;
FIG. 4 is a flow chart of another control authority control method according to an embodiment of the present application;
FIG. 5 is a flow chart of a method of controlling rights of yet another control in accordance with an embodiment of the application;
FIG. 6 is a schematic diagram of a control device for controlling rights of a control according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an alternative computer device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a schematic diagram of an optional control authority control system according to an embodiment of the present application, where the control authority control system includes a terminal 101.
The terminal 101 may obtain first permission information and second permission information, where the first permission information is used to indicate a corresponding relationship between a user identity and a user role, the second permission information is used to indicate a corresponding relationship between service information and a use permission of a control in a service page, the service information includes the user role, a service operation type, and a service use state of the control, then the target service page is obtained, at least one data line is included in the target service page, the target service page is parsed to obtain a user identity of a current user and a target control in the target service page, if a selected target data line exists in the target service page based on a message component, the current service operation type is obtained, then the first permission information and the second permission information are matched to determine that the target control corresponds to the target use permission of the target data line, and finally, the target service page of the terminal 101 can display the target use permission of the target control corresponding to the target data line, so that the current user can operate the target data line based on the target control.
The terminal 101 may be a notebook computer, a desktop computer, etc., and is not exemplified herein.
Notably, control of control permissions is typically web-enabled by itself and no binding interactions with the backend can be performed.
For control of control authorities in a business page, two main implementations exist at present, and the first is to control whether the control is available directly through a disabled attribute. In this way, the system can be used only in a system with a small traffic. Because the authority of each control at this time must be written in the business, which is equivalent to the control of tiny authorities, the control is put on each page, and the later maintenance is quite difficult; and the second is to control the authority of the control with the same operation mode through public configuration check control. The second way to bind data is to bind dynamic data, that is, to confirm whether the control is available according to the field of the dynamic data, for example, the field is in an open state, and the control is only available. However, the dynamic data is acquired through a data subscription mode, namely, the dynamic data is acquired through a broadcasting mode, and it is seen that subscription dynamic data is directly from the whole scope, a certain message change is browsed, a message source is not needed to be seen, and a user needs to browse from massive contents slowly. Therefore, the method not only causes a large amount of client memory to be occupied, but also reduces the control efficiency of the control authority.
Based on the above, the embodiment of the invention provides a control method and a device, computer equipment and a storage medium for controlling the control authority, which not only can reduce the use of a client memory, but also can improve the control efficiency of the control authority.
According to an embodiment of the present invention, there is provided an embodiment of a control authority control method, it should be noted that, steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, steps shown or described may be executed in an order different from that shown or described herein.
The embodiment provides a control method of control authorities, which can be used for the terminal. Fig. 2 is a flowchart of a control method for controlling rights of a control according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S201, acquiring first authority information and second authority information.
The first authority information is used for indicating the corresponding relation between the user identity and the user role, the second authority information is used for indicating the corresponding relation between the service information and the use authority of the control in the service page, and the service information comprises the user role, the service operation type and the service use state of the control.
Specifically, each user identity has a unique user role, and for example, the user identity may be any one of a super user, an admin_user, a resource_user, a read only user, and a device_user. The use rights of the controls corresponding to each user role are different, and the same user role can have the use rights of multiple controls.
In an alternative implementation, the first rights information may be configured in such a way that
export const buttonPermissionsOption={
Device discovery. Key name (service module): key value (user role)
pool:"super_user,root,admin_user"
………
}
Wherein pool represents the storage pool function, super_user, admin_user represents that the storage pool function is only used by super users and common users.
As another example, the first rights information is configured by
export const buttonPermissionsOption={
Device discovery. Key name (service module): key value (user role)
pool:"super_user,root,admin_user,readonly user,resource user,device_user"
………
}
Wherein pool represents a storage pool function, and super_user, root, admin_user, read only user, resource user, device_user represent storage pool functions that can be used by super users, general users, read-only users, resource users, and device users.
In some optional implementations, the second permission information is a value|action|state|dynamic name, where value is a user role, that is, whether the user role of the current user matches the user role in the first permission information. The action is a service operation type, and the user roles comprise create, edit, delete and all, wherein the create represents a new service; the edit represents an editing service; delete represents delete service; all stands for unrestricted traffic, i.e. all are available. The state is a service use state, and when the state is true, the control is represented as an unavailable state; when the state is false, the representative control is in an available state. Here, the switch may affect the service usage state of the control, for example, the service operation type is editing service, and then the shared switch is turned on, that is, the state is false, so that editing can be performed, or column value judgment, for example, the normal state of the storage pool, so that the capacity reduction operation can be performed. The dynamic name is a dynamic state parameter, and the dynamic state parameter is used when a target data line in a message component in a subsequent step changes, and is not described herein. It should be noted that, the priority of the dynamic state parameter is higher than the priority of the service usage state, and the priority of the service usage state is higher than the priority of the service operation type.
Illustratively, the newly created service may be specifically configured as a let createstatus=ref (value: "pool|create"); editing services may be specifically configured as a let editstatus=ref (value: "pool|edit"); wherein the editing service automatically associates the data lines.
For example, the traffic usage status may be obtained by a function let capInfoStatus =ref (value: "pool|wait|+ (replytype. Index of ('san') < 0)), where replytype is the deployment style, and since replytype is known, the result of replytype. Index of ('san') <0 is directly assigned to state. Here, the depoytype. Index of ('san') < 0) indicates that no block service is currently deployed, and thus status is true (i.e., true is assigned to state), so the control is in an unavailable state.
The service usage status may also be obtained by the function let credit status=ref (value: "pool|wait|+" (pool select ratio. Value. Status= =4) + "|credit status|", where the pool select ratio. Value. Status is a dynamic value, and if the pool select ratio. Value. Status is 4, it represents that the storage pool is abnormal, no capacity reduction can be performed, and at this time, the pool select ratio. Value. Status is converted to true or false, so as to determine whether the control is available. In addition, because only when a data line is selected in operation, whether the control is available can be judged through the powerSelectRaow.value.status, and because the status is dynamically changed at present, the dynamic name is used when the target data line in the message component is changed, and the dynamic name is named as "cruschstatus" at this time.
It should be noted that when the target data line in the message part changes, in addition to placing the data line in the message part (i.e., store. Select rows), the cruschstatus is also placed in the status container of the message part (i.e., store. State).
Step S202, a target business page is acquired.
When the terminal loads the target service page, the target service page can be obtained, wherein the target service page comprises at least one data line, for example, as shown in fig. 3, the target service page comprises a plurality of data lines, and the data lines comprise information such as names, creation time and the like.
And step S203, analyzing the target business page to obtain the user identity of the current user and the target control in the target business page.
If the current user logs in the target service page or the current user loads the target service page on the terminal, the target service page can be analyzed to obtain the user identity of the current user and all target controls in the target service page. The target control is a control on the target service page, for example, a control such as "delete", "rollback", "swipe" and the like as shown in fig. 3.
In some alternative implementations, v-permission = "permission status" may be invoked to bind the control with the target business page, i.e., the configuration of the let permission = "pool|edit +" + (pool select ratio. Value. Status = = 4) + "|permission |" is passed to the permission component, through which the control permissions are controlled.
It should be noted that, as long as the control binds v-permission, it represents the unified control logic of the page load element to force use of permission components.
Step S204, if the selected target data line exists in the target business page based on the message component, the current business operation type is obtained.
Illustratively, each time there is a selected target data line in the target business page, the message component will capture the target data line using the store. Select Rows method and store the target data line.
Specifically, in the target business page, each time the form component has a data line, the data content in the data line is assigned to the specified array, for example, the data content in the data line is placed in store.
The method includes that a grid store hook (store) of a message component can be called in a permission component to judge whether a data line is selected in a target service page, wherein the grid store hook is a message source, and the store is a subscription method. If a data line is selected in the target service page, for example, a data line is selected from no data lines, or two data lines are selected from one data line, the function gridstore hook is actively executed.
Step S205, based on the user identity of the current user and the current business operation type, matching is performed in the first authority information and the second authority information, and the target control is determined to correspond to the target use authority of the target data line.
The current business operation type may be a data row in the full-selection target business page, or a plurality of rows of data rows are selected, or a certain row of data rows is selected, etc., wherein the selected data row is the target data row.
In addition, by matching the user identity of the current user with the first authority information and matching the result of matching the user identity of the current user with the first authority information and the current business operation type with the second authority information, the target use authority of the target control corresponding to the target data row can be determined.
According to the control method for the control permission provided by the embodiment, after the first permission information, the second permission information and the target service page are acquired, the selected target data row in the target service page is captured by the message component, then the current service operation type is acquired, the target control is determined to correspond to the target use permission of the target data row based on the user identity of the current user and the current service operation type by matching in the first permission information and the second permission information, a large amount of subscription data is not needed to be cached, the data row is searched from the large amount of subscription data, that is, the state change of the targeted control permission influenced by the actual service only needs to be monitored without monitoring the data change of all service areas, so that the use of a memory of a client is reduced, and meanwhile, the control efficiency of the control permission is improved.
The embodiment provides a control method of control authorities, which can be used for the terminal. Fig. 4 is a flowchart of a control method for controlling rights of a control according to an embodiment of the present invention, as shown in fig. 4, the flowchart includes the following steps:
step S401, acquiring first authority information and second authority information.
Please refer to step S201 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S402, a target business page is acquired.
Please refer to step S202 in the embodiment shown in fig. 2, which is not described herein.
And step S403, analyzing the target business page to obtain the user identity of the current user and the target control in the target business page.
Please refer to step S203 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S404, if the selected target data line exists in the target business page based on the message component, the current business operation type is obtained.
Please refer to step S204 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S405, based on the user identity of the current user and the current business operation type, matching is performed in the first authority information and the second authority information, and the target control is determined to correspond to the target use authority of the target data line.
Specifically, the step S405 includes:
step S4051, the user identity of the current user is matched with the first authority information.
Specifically, a _ include (a, role) method may be used to determine whether the current user has service operation authority for the target service page, if the _ include (a, role) returns a true result, where a is the user identity and role is the user role, representing that the current user has service operation authority of the storage pool (i.e., the target service page). Judging whether the first authority information contains the user role of the current user or not through a _. Include (a, role) method. Conversely, if the _. Include (a, role) is false, the token matching is unsuccessful, i.e., the current user does not have business operation rights to the target business page.
Step S4052, if the user identity of the current user is matched with the first authority information, obtaining the target user role of the current user.
And matching the user identity of the current user with the first authority information, namely, matching the user identity of the current user with the user identity in the first authority information, and if the user identity of the current user is matched with a certain user identity in the first authority information, searching a corresponding target user role in the corresponding relation between the user identity and the user role based on the user identity in the first authority information.
Step S4053, the current business operation type and the target user role are matched with the second authority information, and the target control is determined to correspond to the target use authority of the target data line.
The current service operation type may be a new service, an edit service, a delete service, or an unrestricted service (i.e., all), where both the edit service and the delete service are associated with the target data row, and the new service and the unrestricted service may be independent of the target data row.
In the embodiment including steps S4051 to S4053, by matching the user identity of the current user with the first permission information, the target user role of the current user can be obtained when the user identity of the current user is matched with the first permission information, and then by matching the current service operation type and the target user role with the second permission information, the target use permission of the target control corresponding to the target data line can be determined, thereby realizing control of control-level permission and not conflicting with menu-level permission control. The control authority control can be not influenced by module codes, has low coupling, is easy to transplant and use in various angularjs systems, and has better universality.
In some optional embodiments, the service operation type in the second authority information includes a first service operation type, and the step S4053 specifically includes:
step a1, if the target user role is matched with the user role in the second authority information, and the target user role is a preset user role, and the current service operation type is matched with the first service operation type, determining the service use state corresponding to the target control in the second authority information.
The first service operation type is unrestricted service, and the preset user role is read-only user. The manner of determining the service usage status corresponding to the target control in the second permission information is shown in step S201 in the embodiment shown in fig. 2, which is not described herein again.
And a step a2, if the service use state corresponding to the target control is an available state, determining that the target use permission of the target control corresponding to the target data line is an available permission.
In some alternative embodiments, if the target user role does not match the preset user role and the service state is an available state, determining that the target usage rights of the target control corresponding to the target data line are available rights.
Further, in some optional embodiments, when the target data line in the message component changes, that is, when the selected target data line captured by the message component changes, the authority configuration parameter corresponding to the target control may be parsed to obtain a dynamic state parameter, where the dynamic state parameter is used to indicate that the target data line changes, and then the service usage state of the target control is redetermined according to the dynamic state parameter, at this time, the service usage state may be put into a store state and stored, and finally, according to the service usage state, the target usage authority of the target control corresponding to the target data line is updated.
Specifically, when the target data line in the message component changes, the target data line is put into the message component (namely store. Select Rows), and the authority configuration parameter corresponding to the target control is analyzed, so that a dynamic state parameter can be obtained, therefore, the cruschstatus is also put into a state container (namely store. State) of the message component to be stored, therefore, whether the dynamic state parameter exists in the store. State or not can be circularly inquired, when the dynamic state parameter exists in the store. State, the service use state corresponding to the dynamic state parameter can be taken out, at this time, the service use state is the latest state obtained through the current service operation, and the newly obtained service use state can cover the initialized service use state, wherein the service use state can directly control the display and the hidden of the control.
The method includes that a grid store hook (store) of a message component can be called in a permission component to judge whether a target data line changes, wherein the grid store hook is a message source, and the store is a subscription method. If the target data line changes, for example, a line of data is selected from none of the data lines, or two lines of data are selected from one of the data lines, the function gridstore hook $ subset (store) is actively executed.
In some alternative embodiments, if it is determined based on the message component that the selected target data line does not exist in the target service page, the initial usage rights of the target control are determined based on the user identity of the current user, the first rights information, and the second rights information.
In some alternative embodiments, the pool is parsed into value (i.e., user role) by invoking v-permission= "crushStatus", i.e., the target user role matched in the first permission information is parsed into the user role in the second permission information; analyzing the character edit into action (namely service operation type), namely analyzing the current service operation type into the service operation type in the second authority information, wherein the main function is to determine whether to associate data lines; and analyzing the judgment result of the crushStatus into a state (namely a service use state), namely the transmitted service use state. If the parsed item does not exist, the service use state is automatically converted into a false processing, and the state is false, namely the target control is in an available state.
Further, if v-permission has no value, the target usage permission of the target control is the available permission, i.e. the target control is highlighted.
In addition, by analyzing the character wait into action, it can be determined whether the current service operation type is related to the data line, for example, if action is to create service or not limit service, it can be determined that the current service operation type is not related to the data line.
In some optional embodiments, determining the initial usage right of the target control based on the user identity of the current user, the first right information and the second right information may specifically be to match the user identity of the current user with the first right information, if the user identity of the current user is matched with the first right information, obtain the target user role of the current user, and finally match the target user role with the second right information, to determine the initial usage right of the target control.
For example, if the user identity of the current user does not match the first permission information, determining that the initial use permission of the target control is an unavailable permission.
Further, if the target user role is matched with the second authority information, determining the initial use authority of the target control through the current service operation type and the service use state corresponding to the target control is needed.
In some optional implementations, when no data line is selected in the target service page, the initial usage right of the target control may be determined in a plurality of ways, for example, the service operation type in the second right information further includes a second service operation type, and if the current service operation type does not match the second service operation type or the first service operation type, and/or the service usage state corresponding to the target control is an unavailable state, the initial usage right of the target control is an unavailable right, where the second service operation type is a creation service; for another example, if the current business operation type is matched with the second business operation type and the user identity of the current user is a read-only user, the initial use permission of the target control is an unavailable permission, that is, the target control is rendered gray.
It can be understood that the first authority information and the second authority information in the embodiment of the application can be configured separately, and the authority of the internal control of the service is managed and controlled by itself; the logic internal processing of the control authority, the data line subscription mechanism and the like can be completely universal; in addition, the mechanism processing of state change monitoring in the embodiment of the application ensures that the control can change along with the actual value of the service scene, and the control can be universal no matter how complex the application scene is.
In order to more clearly illustrate the process of controlling the rights of the control, a specific example will be described below.
Referring to fig. 5, first, a current user performs a page operation on a target service page, then determines, based on a message component, that there is a selected target data line in the target service page, that is, the target data line is subscribed to, and may store the target data line in a data storage unit, at this time, permission analysis may be performed on a target control on the target service page, that is, service information (that is, a user role, a service operation type, and a service usage state of the control) of the target control may be analyzed, and before analysis is performed on the target control, first permission information and second permission information need to be configured. After the target control is analyzed, the target control is bound with a control component (i.e. a permission component), the target control is associated with a preset function v-permission, then the matching is carried out in the first permission information and the second permission information based on the user identity of the current user and the current service operation type through the control component, the target usage permission of the target control corresponding to the target data row is determined, namely, the user identity is subjected to role matching with the first permission information, if the user identity of the current user is matched with the first permission information, the target user role of the current user is obtained, the current service operation type is matched with the target user role with the second permission information, if the target user role is matched with the user role in the second permission information, the target user role is the preset user role, and the current service operation type is matched with the first service operation type, the service usage state corresponding to the target control in the second permission information is determined, and if the service usage state corresponding to the target control is the available permission state, the target control is determined to be used corresponding to the target data row, and finally, the target operation of the target control is determined to be available, and the service is fed back to the service control through the rendering permission page.
Referring to fig. 6, an embodiment of the present application further provides a control device for controlling rights of a control, including:
the first obtaining module 601 is configured to obtain first permission information and second permission information, where the first permission information is used to indicate a corresponding relationship between a user identity and a user role, and the second permission information is used to indicate a corresponding relationship between service information and a usage permission of a control in a service page, and the service information includes the user role, a service operation type, and a service usage state of the control;
a second obtaining module 602, configured to obtain a target service page, where the target service page includes at least one data line;
the parsing module 603 is configured to parse the target service page to obtain a user identity of the current user and a target control in the target service page;
a third obtaining module 604, configured to obtain the current service operation type if it is determined based on the message component that the selected target data line exists in the target service page;
the first usage right determining module 605 is configured to determine, based on the user identity of the current user and the current service operation type, a target usage right of the target control corresponding to the target data line by matching the first right information and the second right information.
In some alternative embodiments, the first usage right determining module 605 specifically includes:
the first matching sub-module is used for matching the user identity of the current user with the first authority information;
the first user role determination submodule is used for obtaining a target user role of the current user if the user identity of the current user is matched with the first authority information;
the first usage right determining sub-module is used for matching the current business operation type and the target user role with the second right information and determining the target usage right of the target control corresponding to the target data line.
In some optional embodiments, the service operation type in the second authority information includes a first service operation type, and the usage authority determining submodule specifically includes:
the service use state determining unit is used for determining the service use state corresponding to the target control in the second authority information if the target user role is matched with the user role in the second authority information, the target user role is a preset user role, and the current service operation type is matched with the first service operation type;
and the use permission determination unit is used for determining that the target use permission of the target control corresponding to the target data row is the available permission if the service use state corresponding to the target control is the available state.
In some optional embodiments, the control device of the control authority further includes:
and the second usage right determining module is used for determining that the target usage right of the target control corresponding to the target data row is the available right if the target user role is not matched with the preset user role and the service usage state is the available state.
In some alternative embodiments, when the target data line in the message component changes, the control device of the control authority further includes:
the dynamic state parameter determining module is used for analyzing the authority configuration parameters corresponding to the target control to obtain dynamic state parameters, wherein the dynamic state parameters are used for indicating the change of the target data row;
the service use state determining module is used for re-determining the service use state of the target control according to the dynamic state parameters;
and the updating module is used for updating the target use permission of the target control corresponding to the target data row according to the service use state.
In some optional embodiments, the control device of the control authority further includes:
and the third usage right determining module is used for determining the initial usage right of the target control based on the user identity of the current user, the first right information and the second right information if the selected target data row does not exist in the target business page based on the message component.
In some optional embodiments, the third usage right determining module specifically includes:
the second matching sub-module is used for matching the user identity of the current user with the first authority information;
the second user role determination submodule is used for obtaining a target user role of the current user if the user identity of the current user is matched with the first authority information;
and the second use permission determination submodule is used for matching the target user role with the second permission information and determining the initial use permission of the target control.
In some alternative embodiments, the service usage status determining unit specifically includes:
and a service usage state determining subunit, configured to determine the service usage state corresponding to the target control in the second permission information based on a function let of crushstatus=ref (value: "pool|edit| +" (pool select window. Value. Status= =4) + "|crushstatus|").
The control device of the control permission and the control method of the control permission are based on the same invention conception, and by setting the message component, after the first permission information, the second permission information and the target service page are acquired, the selected target data line in the target service page is captured by the message component, then the current service operation type is acquired, the matching is carried out between the first permission information and the second permission information based on the user identity of the current user and the current service operation type, the target use permission of the target control corresponding to the target data line is determined, a large amount of subscription data is not needed to be cached, and the data line is searched from a large amount of subscription data, so that the use of a memory of a client is reduced, and meanwhile, the control efficiency of the control permission is improved.
The control authority control device in this embodiment is in the form of a functional module, where the module refers to an application specific integrated circuit (Application Specific Integrated Circuit, abbreviated as ASIC), a processor and a memory that execute one or more software or firmware programs, and/or other devices that can provide the above functions.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The embodiment of the invention also provides computer equipment, and a control device with the control authority shown in the figure 6.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 7, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 7.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform a method for implementing the embodiments described above.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created from the use of the computer device of the presentation of a sort of applet landing page, and the like. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.
Claims (11)
1. The control method of the control authority is characterized by comprising the following steps:
acquiring first authority information and second authority information, wherein the first authority information is used for indicating the corresponding relation between a user identity and a user role, the second authority information is used for indicating the corresponding relation between service information and the use authority of a control in a service page, and the service information comprises the user role, a service operation type and a service use state of the control;
acquiring a target service page, wherein the target service page comprises at least one data line;
analyzing the target business page to obtain the user identity of the current user and a target control in the target business page;
if the selected target data line exists in the target service page based on the message component, acquiring the current service operation type;
and based on the user identity of the current user and the current business operation type, matching is carried out in the first authority information and the second authority information, and the target control is determined to correspond to the target use authority of the target data row.
2. The method of claim 1, wherein the matching in the first rights information and the second rights information based on the user identity of the current user and the current business operation type, determining that the target control corresponds to the target usage rights of the target data line, comprises:
matching the user identity of the current user with the first authority information;
if the user identity of the current user is matched with the first authority information, obtaining a target user role of the current user;
and matching the current business operation type and the target user role with the second authority information, and determining the target use authority of the target control corresponding to the target data line.
3. The method of claim 2, wherein the business operation type in the second permission information comprises a first business operation type, wherein the matching the current business operation type and the target user role with the second permission information determines a target usage permission of the target control corresponding to the target data row, comprising:
if the target user role is matched with the user role in the second authority information, and the target user role is a preset user role, and the current service operation type is matched with the first service operation type, determining the service use state corresponding to the target control in the second authority information;
And if the service use state corresponding to the target control is an available state, determining that the target use permission of the target control corresponding to the target data row is an available permission.
4. The method according to claim 2, wherein the method further comprises:
and if the target user role is not matched with the preset user role and the service use state is an available state, determining that the target use permission of the target control corresponding to the target data row is an available permission.
5. The method of claim 3 or 4, wherein when a change occurs to a target data line in the message component, the method further comprises:
analyzing the authority configuration parameters corresponding to the target control to obtain dynamic state parameters, wherein the dynamic state parameters are used for indicating the change of the target data row;
the service use state of the target control is redetermined according to the dynamic state parameters;
and updating the target use permission of the target control corresponding to the target data row according to the service use state.
6. The method according to claim 1, wherein the method further comprises:
And if the selected target data row does not exist in the target business page based on the message component, determining the initial use permission of the target control based on the user identity of the current user, the first permission information and the second permission information.
7. The method of claim 6, wherein the determining the initial usage rights for the target control based on the user identity of the current user, the first rights information, and the second rights information comprises:
matching the user identity of the current user with the first authority information;
if the user identity of the current user is matched with the first authority information, obtaining a target user role of the current user;
and matching the target user role with the second authority information, and determining the initial use authority of the target control.
8. The method of claim 3, wherein the determining the service usage state corresponding to the target control in the second permission information includes:
and determining the service usage state corresponding to the target control in the second authority information based on a function let of crushstatus=ref (value: "pool|edit|+" (pool select window. Value. Status= =4) + "|crushstatus|").
9. A control device for controlling rights of a control, comprising:
the system comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring first authority information and second authority information, the first authority information is used for indicating the corresponding relation between a user identity and a user role, the second authority information is used for indicating the corresponding relation between service information and the use authority of a control in a service page, and the service information comprises the user role, a service operation type and a service use state of the control;
the second acquisition module is used for acquiring a target service page, wherein the target service page comprises at least one data line;
the analysis module is used for analyzing the target service page to obtain the user identity of the current user and the target control in the target service page;
the third acquisition module is used for acquiring the current service operation type if the selected target data line exists in the target service page based on the message component;
and the first use permission determining module is used for matching the first permission information and the second permission information based on the user identity of the current user and the current business operation type, and determining the target use permission of the target control corresponding to the target data row.
10. A computer device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the control method of the control authority of any one of claims 1 to 8.
11. A computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the control method of the control authority of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311183123.9A CN117195181A (en) | 2023-09-13 | 2023-09-13 | Control authority control method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311183123.9A CN117195181A (en) | 2023-09-13 | 2023-09-13 | Control authority control method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117195181A true CN117195181A (en) | 2023-12-08 |
Family
ID=88986613
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311183123.9A Pending CN117195181A (en) | 2023-09-13 | 2023-09-13 | Control authority control method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117195181A (en) |
-
2023
- 2023-09-13 CN CN202311183123.9A patent/CN117195181A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110557284B (en) | Data aggregation method and device based on client gateway | |
CN107679417B (en) | Method and system for managing user operation authority | |
CN110941779B (en) | Page loading method and device, storage medium and electronic equipment | |
US9350738B2 (en) | Template representation of security resources | |
CN108038665B (en) | Business rule management method, device, equipment and computer readable storage medium | |
CN111124540B (en) | Dynamic configuration method of service control system and service request forwarding method | |
US20220308949A1 (en) | Publishing system, pushing method, application device, receiving device and service management device | |
CN111240892A (en) | Data backup method and device | |
CN110688201B (en) | Log management method and related equipment | |
CN112084199A (en) | Scene-based general parameter maintenance method and device | |
CN105187562A (en) | System and method for operating remote file | |
CN117171108B (en) | Virtual model mapping method and system | |
CN111198678A (en) | Method and device for generating GraphQL front-end operation interface | |
KR20130126012A (en) | Method and apparatusfor providing report of business intelligence | |
CN110457279B (en) | Data offline scanning method and device, server and readable storage medium | |
CN117195181A (en) | Control authority control method and device, computer equipment and storage medium | |
CN109344353B (en) | Configurable local cache refreshing method and terminal | |
US12001458B2 (en) | Multi-cloud object store access | |
US9134930B2 (en) | Delayed content production | |
CN114116646A (en) | Log data processing method, device, equipment and storage medium | |
CN111880946B (en) | Local service providing method, device and equipment and storage medium | |
CN117112654B (en) | City data display method, device, computer equipment and storage medium | |
CN114143187B (en) | Intelligent platform interface network address management method, system, terminal and storage medium | |
US10275224B1 (en) | Just in time generation system | |
CN114697100A (en) | Authentication method, system, terminal and storage medium for front-end and back-end separation setting |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |