A method of performing proximity discovery, performed by a network entity, the method comprising: receiving, from a UE, a discovery request message comprising a Proximity-based Services, ProSe, application identifier, ID, and a UE identity, wherein the ProSe application ID indicates a target group of the UE identity; determining whether the UE is authorized to use the ProSe application ID contained in the request at least by checking for an authorization of the discovery request message based on an authorization of an application represented by the application ID, and authorizing the UE to use the ProSe application ID within a discovery message if the discovery request message is authorized; in response to having determined that the UE is authorized to use the ProSe application ID, obtaining, from a storage unit of the network entity, a discovery code for performing the proximity discovery according to the ProSe application ID associated with a discovery code combination of an announcing UE corresponding to the target group of the UE identity, wherein the discovery code combination comprises a ProSe application code of the announcing UE for a restricted discovery as the announcing UE has indicated the restrict discovery in the ProSe application ID, a ProSe application code of a monitoring UE, and a ProSe application mask, and the discovery code is the ProSe application code for the restricted discovery; and transmitting a discovery response message comprising the discovery code in response to receiving the discovery request message. receiving, from a UE, a discovery request message comprising a Proximity-based Services, ProSe, application identifier, ID, and a UE identity, wherein the ProSe application ID indicates a target group of the UE identity; determining whether the UE is authorized to use the ProSe application ID contained in the request at least by checking for an authorization of the discovery request message based on an authorization of an application represented by the application ID, and authorizing the UE to use the ProSe application ID within a discovery message if the discovery request message is authorized; in response to having determined that the UE is authorized to use the ProSe application ID, obtaining, from a storage unit of the network entity, a discovery code for performing the proximity discovery according to the ProSe application ID associated with a discovery code combination of an announcing UE corresponding to the target group of the UE identity, wherein the discovery code combination comprises a ProSe application code of the announcing UE for a restricted discovery as the announcing UE has indicated the restrict discovery in the ProSe application ID, a ProSe application code of a monitoring UE, and a ProSe application mask, and the discovery code is the ProSe application code for the restricted discovery; and the discovery code combination comprises a ProSe application code of the announcing UE for a restricted discovery as the announcing UE has indicated the restrict discovery in the ProSe application ID, a ProSe application code of a monitoring UE, and a ProSe application mask, and the discovery code is the ProSe application code for the restricted discovery; and transmitting a discovery response message comprising the discovery code in response to receiving the discovery request message. <EOS>