IP_AccessRuleService

In this article:

Introduction

Through the use of IpAccessRuleService bean, we can easily control and put some kind of restriction on Ip address, for user in the system.

Use API

In order to init IpAccessRuleService need to use - Imcms.getServices().getManagedBean(IpAccessRuleService)

IpAccessRule getById(int id);

List<IpAccessRule> getAll();

IpAccessRule create(IpAccessRule rule);

IpAccessRule update(IpAccessRule rule);

void delete(int ruleId);

boolean isAllowedToAccess(InetAddress accessIp, UserDomainObject user);

Note

See also how to use InetAddress here.

Description about fields IpAccessRule

  1. Integer id;

  2. boolean isEnabled;

  3. boolean isRestricted;

  4. String ipRange;

  5. Integer roleId;

  6. Integer userId;