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
Integer id;
boolean isEnabled;
boolean isRestricted;
String ipRange;
Integer roleId;
Integer userId;